Ask Your Question

previous fontsize settings in plot now produce huge fonts

asked 2015-09-16 07:57:35 -0500

stan gravatar image

I have been using p.fontsize(20) a lot, but since the upgrade to 6.8, the same setting now produces HUGE font sizes, making the axes labels exceed the figure sizes. I wonder what happened there and how this could be fixed. I believe that some of the reason is the introduction of the new option axes_labels_size as mentioned here:

Try this in a sage version before 6.7 and after 6.7:

P = plot(x^2, 0,2)
P.axes_labels(['Some value of x', 'Resulting value of y'])

Is there a way to put a one-liner at the start of my worksheets to get back the old behaviour without having to modify all P.fontsize(20) lines?

edit retag flag offensive close merge delete


I have a feeling your answer is at

kcrisman gravatar imagekcrisman ( 2015-09-16 10:13:58 -0500 )edit

kcrisman was right. I moved the answer here.

nbruin gravatar imagenbruin ( 2015-09-16 10:56:02 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2015-09-16 10:54:29 -0500

nbruin gravatar image

It's not a one-liner and not particularly elegant, but you can just wrap another layer around plot to put in another default.

def plot(*args,**kwargs):
    if "axes_labels_size" not in kwargs:
        # perhaps we should copy kwargs before modifying it?
    return sage.plot.plot.plot(*args,**kwargs)

A slight architectural change to more easily accommodate requests like yours would be to rewrite to initialize default values from a dictionary rather than in code. Then one could relatively easily monkey-patch the dictionary.

[I originally put this answer under the wrong question]

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-09-16 07:57:35 -0500

Seen: 91 times

Last updated: Sep 16 '15