ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 16 Sep 2015 10:56:02 -0500previous fontsize settings in plot now produce huge fontshttp://ask.sagemath.org/question/29464/previous-fontsize-settings-in-plot-now-produce-huge-fonts/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/26807/how-do-i-adjust-the-size-of-axes-labels-and-figure-titles-in-plots/
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?
Wed, 16 Sep 2015 07:57:35 -0500http://ask.sagemath.org/question/29464/previous-fontsize-settings-in-plot-now-produce-huge-fonts/Comment by nbruin for <p>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:
<a href="http://ask.sagemath.org/question/26807/how-do-i-adjust-the-size-of-axes-labels-and-figure-titles-in-plots/">http://ask.sagemath.org/question/2680...</a></p>
<p>Try this in a sage version before 6.7 and after 6.7:</p>
<pre><code>P = plot(x^2, 0,2)
P.axes_labels(['Some value of x', 'Resulting value of y'])
P.fontsize(20)
P
</code></pre>
<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?</p>
http://ask.sagemath.org/question/29464/previous-fontsize-settings-in-plot-now-produce-huge-fonts/?comment=29472#post-id-29472kcrisman was right. I moved the answer here.Wed, 16 Sep 2015 10:56:02 -0500http://ask.sagemath.org/question/29464/previous-fontsize-settings-in-plot-now-produce-huge-fonts/?comment=29472#post-id-29472Comment by kcrisman for <p>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:
<a href="http://ask.sagemath.org/question/26807/how-do-i-adjust-the-size-of-axes-labels-and-figure-titles-in-plots/">http://ask.sagemath.org/question/2680...</a></p>
<p>Try this in a sage version before 6.7 and after 6.7:</p>
<pre><code>P = plot(x^2, 0,2)
P.axes_labels(['Some value of x', 'Resulting value of y'])
P.fontsize(20)
P
</code></pre>
<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?</p>
http://ask.sagemath.org/question/29464/previous-fontsize-settings-in-plot-now-produce-huge-fonts/?comment=29469#post-id-29469I have a feeling your answer is at http://ask.sagemath.org/question/26807/how-do-i-adjust-the-size-of-axes-labels-and-figure-titles-in-plots/?answer=29467#post-id-29467Wed, 16 Sep 2015 10:13:58 -0500http://ask.sagemath.org/question/29464/previous-fontsize-settings-in-plot-now-produce-huge-fonts/?comment=29469#post-id-29469Answer by nbruin for <p>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:
<a href="http://ask.sagemath.org/question/26807/how-do-i-adjust-the-size-of-axes-labels-and-figure-titles-in-plots/">http://ask.sagemath.org/question/2680...</a></p>
<p>Try this in a sage version before 6.7 and after 6.7:</p>
<pre><code>P = plot(x^2, 0,2)
P.axes_labels(['Some value of x', 'Resulting value of y'])
P.fontsize(20)
P
</code></pre>
<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?</p>
http://ask.sagemath.org/question/29464/previous-fontsize-settings-in-plot-now-produce-huge-fonts/?answer=29471#post-id-29471It'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]Wed, 16 Sep 2015 10:54:29 -0500http://ask.sagemath.org/question/29464/previous-fontsize-settings-in-plot-now-produce-huge-fonts/?answer=29471#post-id-29471