From: Michael Orlitzky Date: Tue, 10 Nov 2015 22:10:10 +0000 (-0500) Subject: Remove mjo/plot.py, merged in http://trac.sagemath.org/ticket/19485. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=b397966ded7306845c51c90efb559686f500eb04;p=sage.d.git Remove mjo/plot.py, merged in http://trac.sagemath.org/ticket/19485. --- diff --git a/mjo/plot.py b/mjo/plot.py deleted file mode 100644 index 21bd24c..0000000 --- a/mjo/plot.py +++ /dev/null @@ -1,62 +0,0 @@ -""" -Plotting helpers. - - * We set the default tick_formatter to 'latex'. - - * We replace the plot() function with our own version that sets some - default legend options. - -""" - -from sage.all import * - -# Graphics.SHOW_OPTIONS contains the default options that will be -# passed to show(). It already handles merging the user-specified -# options, so we just tap into that power. -show_opts = sage.plot.graphics.Graphics.SHOW_OPTIONS -show_opts['tick_formatter'] = 'latex' - -# Save the original implementation so that we can call it from -# within mjo_plot. -plot_impl = sage.plot.plot._plot -list_plot_impl = sage.plot.plot.list_plot - -def mjo_plot(*args, **kwargs): - """ - Replacement for the default plot function. - - - If there's a legend, set the background color to 'white' and - give it a drop shadow. - - """ - default_legend_opts = { 'back_color': 'white', - 'shadow': True } - - p = plot_impl(*args, **kwargs) - p.set_legend_options(**default_legend_opts) - - return p - - -def mjo_list_plot(*args, **kwargs): - """ - Replacement for the default list_plot function. - - - If there's a legend, set the background color to 'white' and - give it a drop shadow. - - """ - default_legend_opts = { 'back_color': 'white', - 'shadow': True } - - p = list_plot_impl(*args, **kwargs) - p.set_legend_options(**default_legend_opts) - - return p - - -# This way, we don't have to try to replace all of the calls to plot() -# and list_plot(); we just replace the two function that did the -# actual implementations. -sage.plot.plot._plot = mjo_plot -sage.plot.plot.list_plot = mjo_list_plot