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.Sat, 11 May 2019 15:34:11 -0500Plot boxes have jumpy xy ranges in log scalehttp://ask.sagemath.org/question/26637/plot-boxes-have-jumpy-xy-ranges-in-log-scale/Note: this is an attempt to concisely rephrase the issue at
[ask-sage question 26623](http://ask.sagemath.org/question/26623/modifying-xmin-value-and-frame-of-a-plot/).
Plotting in log scale, the bounding box doesn't adjust well to xmin, xmax, ymin, ymax.
It seems that plot bounding boxes are set with increments not adapted to log scale.
The following example illustrates this jumpiness in certain ranges of values.
opt = { 'ymin': 1, 'ymax': 25, 'scale': ('loglog', 10), 'frame': True }
def p(a): return plot(x, xmin=a, xmax=25, **opt)
for a in (1.2, 2, 3, 4): p(a).show() # poor xmin for bbox
for a in (4.5, 7, 10, 14): p(a).show() # poor xmax for bbox
for a in (12, 14, 20, 23): p(a).show() # poor xmin and xmax
Fri, 24 Apr 2015 07:36:38 -0500http://ask.sagemath.org/question/26637/plot-boxes-have-jumpy-xy-ranges-in-log-scale/Comment by slelievre for <p>Note: this is an attempt to concisely rephrase the issue at
<a href="http://ask.sagemath.org/question/26623/modifying-xmin-value-and-frame-of-a-plot/">ask-sage question 26623</a>.</p>
<p>Plotting in log scale, the bounding box doesn't adjust well to xmin, xmax, ymin, ymax.</p>
<p>It seems that plot bounding boxes are set with increments not adapted to log scale.</p>
<p>The following example illustrates this jumpiness in certain ranges of values.</p>
<pre><code>opt = { 'ymin': 1, 'ymax': 25, 'scale': ('loglog', 10), 'frame': True }
def p(a): return plot(x, xmin=a, xmax=25, **opt)
for a in (1.2, 2, 3, 4): p(a).show() # poor xmin for bbox
for a in (4.5, 7, 10, 14): p(a).show() # poor xmax for bbox
for a in (12, 14, 20, 23): p(a).show() # poor xmin and xmax
</code></pre>
http://ask.sagemath.org/question/26637/plot-boxes-have-jumpy-xy-ranges-in-log-scale/?comment=46489#post-id-46489Possibly related:
- [Ask Sage question 46482: Plot points in loglog scale](https://ask.sagemath.org/question/46482)Sat, 11 May 2019 15:34:11 -0500http://ask.sagemath.org/question/26637/plot-boxes-have-jumpy-xy-ranges-in-log-scale/?comment=46489#post-id-46489