X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Fplot.py;h=0eaf079fa5343bed2b32d6747bf0ab6f69995ed6;hb=69190cb4e87a8a6ab0193109dafca60962b6df0b;hp=d33012314db2dae46713ca10c2389063acac58ef;hpb=3a61b951df61f4175bcf61700454ed978b63b2ef;p=sage.d.git diff --git a/mjo/plot.py b/mjo/plot.py index d330123..0eaf079 100644 --- a/mjo/plot.py +++ b/mjo/plot.py @@ -14,19 +14,25 @@ def mjo_plot(*args, **kwargs): """ plot_opts = { 'tick_formatter': 'latex' } - - legend_opts = { 'back_color': 'white', - 'shadow': True } # Merge the user's plot options with mine. The ones given as # kwargs should override the defaults! plot_opts.update(kwargs) kwargs = plot_opts + p = sage_plot(*args, **kwargs) - p.set_legend_options(**legend_opts) + + # Merge the user's legend options with mine. The ones passed to us + # should override the defaults! + default_legend_opts = { 'back_color': 'white', + 'shadow': True } + default_legend_opts.update(p._Graphics__legend_opts) + p._Graphics__legend_opts = default_legend_opts + return p -# Replace both the global `plot` and the one in the module. I am +# Replace both the global `plot` and the ones in the modules. I am # unclear about why this is necessary, and don't care too much. sage.plot.plot.plot = mjo_plot +sage.plot.all.plot = mjo_plot plot = mjo_plot