]>
gitweb.michael.orlitzky.com - sage.d.git/blob - mjo/plot.py
4 * We set the default tick_formatter to 'latex'.
6 * We replace the plot() function with our own version that sets some
7 default legend options.
11 from sage
.all
import *
13 # Graphics.SHOW_OPTIONS contains the default options that will be
14 # passed to show(). It already handles merging the user-specified
15 # options, so we just tap into that power.
16 show_opts
= sage
.plot
.graphics
.Graphics
.SHOW_OPTIONS
17 show_opts
['tick_formatter'] = 'latex'
19 # Save the original implementation so that we can call it from
21 plot_impl
= sage
.plot
.plot
._plot
23 def mjo_plot(*args
, **kwargs
):
25 Replacement for the default plot function.
27 - If there's a legend, set the background color to 'white' and
28 give it a drop shadow.
31 default_legend_opts
= { 'back_color': 'white',
34 # Create an empty plot using the default options.
36 p
.set_legend_options(**default_legend_opts
)
38 # After trac #12936, this should propagate those options.
39 p
+= plot_impl(*args
, **kwargs
)
43 # This way, we don't have to try to replace all of the calls to
44 # plot(); we just replace the one function that did the actual
46 sage
.plot
.plot
._plot
= mjo_plot