Ask Your Question
0

previous fontsize settings in plot now produce huge fonts

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

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: http://ask.sagemath.org/question/2680...

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'])
P.fontsize(20)
P

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

Comments

I have a feeling your answer is at http://ask.sagemath.org/question/2680...

kcrisman gravatar imagekcrisman ( 2015-09-16 17:13:58 +0100 )edit

kcrisman was right. I moved the answer here.

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

1 Answer

Sort by ยป oldest newest most voted
0

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

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?
        kwargs['axes_labels_size']=1.0
    return sage.plot.plot.plot(*args,**kwargs)

A slight architectural change to more easily accommodate requests like yours would be to rewrite sage.plot.graphics 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

Stats

Asked: 2015-09-16 14:57:35 +0100

Seen: 357 times

Last updated: Sep 16 '15