ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 11 May 2019 22:34:11 +0200Plot boxes have jumpy xy ranges in log scalehttps://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 14:36:38 +0200https://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>
https://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 22:34:11 +0200https://ask.sagemath.org/question/26637/plot-boxes-have-jumpy-xy-ranges-in-log-scale/?comment=46489#post-id-46489