Ask Your Question

previous fontsize settings in plot now produce huge fonts

asked 2015-09-16 14:57:35 +0200

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 17:13:58 +0200 )edit

kcrisman was right. I moved the answer here.

nbruin gravatar imagenbruin ( 2015-09-16 17:56:02 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-09-16 17:54:29 +0200

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 14:57:35 +0200

Seen: 310 times

Last updated: Sep 16 '15