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 legend_opts
= { 'back_color': 'white',
21 # Merge the user's plot options with mine. The ones given as
22 # kwargs should override the defaults!
23 plot_opts
.update(kwargs
)
25 p
= sage_plot(*args
, **kwargs
)
26 p
.set_legend_options(**legend_opts
)
29 # Replace both the global `plot` and the one in the module. I am
30 # unclear about why this is necessary, and don't care too much.
31 sage
.plot
.plot
.plot
= mjo_plot