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, 13 Apr 2019 13:48:31 +0200non monometric axeshttps://ask.sagemath.org/question/46120/non-monometric-axes/ Hi,
during plotting a simple 2d function, I get the right range written for x axis (ex. -5,5) but the y axis seems to be "expanded" to 100...So, how can I get the same range (-5,5) for y axis?
Thank youSat, 13 Apr 2019 08:59:55 +0200https://ask.sagemath.org/question/46120/non-monometric-axes/Comment by slelievre for <p>Hi,
during plotting a simple 2d function, I get the right range written for x axis (ex. -5,5) but the y axis seems to be "expanded" to 100...So, how can I get the same range (-5,5) for y axis?</p>
<p>Thank you</p>
https://ask.sagemath.org/question/46120/non-monometric-axes/?comment=46126#post-id-46126Welcome to Ask Sage! Thank you for your question.Sat, 13 Apr 2019 12:55:41 +0200https://ask.sagemath.org/question/46120/non-monometric-axes/?comment=46126#post-id-46126Comment by slelievre for <p>Hi,
during plotting a simple 2d function, I get the right range written for x axis (ex. -5,5) but the y axis seems to be "expanded" to 100...So, how can I get the same range (-5,5) for y axis?</p>
<p>Thank you</p>
https://ask.sagemath.org/question/46120/non-monometric-axes/?comment=46127#post-id-46127Please provide an example that others can paste in a fresh Sage session to reproduce the problem.
This makes it a lot easier for others to explore the problem, increasing the chances of a fast answer.Sat, 13 Apr 2019 12:56:46 +0200https://ask.sagemath.org/question/46120/non-monometric-axes/?comment=46127#post-id-46127Answer by slelievre for <p>Hi,
during plotting a simple 2d function, I get the right range written for x axis (ex. -5,5) but the y axis seems to be "expanded" to 100...So, how can I get the same range (-5,5) for y axis?</p>
<p>Thank you</p>
https://ask.sagemath.org/question/46120/non-monometric-axes/?answer=46129#post-id-46129The solution to this problem is probably to specify `ymin` and `ymax`.
For example:
sage: p = plot(lambda x: 1/x, (-5, 5))
sage: p.show(ymin=-5, ymax=5)
Sat, 13 Apr 2019 13:48:31 +0200https://ask.sagemath.org/question/46120/non-monometric-axes/?answer=46129#post-id-46129