3 # Save the default so that we can call it within mjo_plot.
6 def mjo_plot(*args
, **kwargs
):
8 Replacement for the default plot function.
10 - Use the 'latex' tick formatter.
12 - If there's a legend, set the background color to 'white' and
13 give it a drop shadow.
16 plot_opts
= { 'tick_formatter': 'latex' }
18 # Merge the user's plot options with mine. The ones given as
19 # kwargs should override the defaults!
20 plot_opts
.update(kwargs
)
23 p
= sage_plot(*args
, **kwargs
)
25 # Merge the user's legend options with mine. The ones passed to us
26 # should override the defaults!
27 default_legend_opts
= { 'back_color': 'white',
29 default_legend_opts
.update(p
._Graphics
__legend
_opts
)
30 p
._Graphics
__legend
_opts
= default_legend_opts
34 # Replace both the global `plot` and the ones in the modules. I am
35 # unclear about why this is necessary, and don't care too much.
36 sage
.plot
.plot
.plot
= mjo_plot
37 sage
.plot
.all
.plot
= mjo_plot