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.Fri, 19 May 2017 19:25:47 +0200Scale axis width=1 and height=1https://ask.sagemath.org/question/37631/scale-axis-width1-and-height1/Hello,
I would like to scale the y-axis or the x-axis, so that the grid consists of squares with width=1 and also height=1. Because if i draw elliptic curves, it will deform them.
Thank you very much!
Edit: apparently the code is
p3=plot(EllipticCurve([0,0,0,-3.141592654,1.414213562]), color='black', gridlines='true')
show(p3)
p3.axes_labels(['x','y'])
p3.save('ec1.pdf')Fri, 19 May 2017 15:40:06 +0200https://ask.sagemath.org/question/37631/scale-axis-width1-and-height1/Answer by tmonteil for <p>Hello,</p>
<p>I would like to scale the y-axis or the x-axis, so that the grid consists of squares with width=1 and also height=1. Because if i draw elliptic curves, it will deform them.
Thank you very much!</p>
<p>Edit: apparently the code is</p>
<pre><code>p3=plot(EllipticCurve([0,0,0,-3.141592654,1.414213562]), color='black', gridlines='true')
show(p3)
p3.axes_labels(['x','y'])
p3.save('ec1.pdf')
</code></pre>
https://ask.sagemath.org/question/37631/scale-axis-width1-and-height1/?answer=37635#post-id-37635It would be easier to help with your exact code.
When you use the `plot` function (or method), you can pass the option `aspect_ratio=1`.
**EDIT**: in your concrete example, you can do:
sage: p3=plot(EllipticCurve([0,0,0,-3.141592654,1.414213562]), color='black', gridlines='true', aspect_ratio=1)Fri, 19 May 2017 17:08:18 +0200https://ask.sagemath.org/question/37631/scale-axis-width1-and-height1/?answer=37635#post-id-37635Comment by test1234 for <p>It would be easier to help with your exact code.</p>
<p>When you use the <code>plot</code> function (or method), you can pass the option <code>aspect_ratio=1</code>.</p>
<p><strong>EDIT</strong>: in your concrete example, you can do:</p>
<pre><code>sage: p3=plot(EllipticCurve([0,0,0,-3.141592654,1.414213562]), color='black', gridlines='true', aspect_ratio=1)
</code></pre>
https://ask.sagemath.org/question/37631/scale-axis-width1-and-height1/?comment=37636#post-id-37636Of course,
p3=plot(EllipticCurve([0,0,0,-3.141592654,1.414213562]), color='black', gridlines='true')
show(p3)
p3.axes_labels(['$x$','$y$'])
p3.save('ec1.pdf')Fri, 19 May 2017 19:25:47 +0200https://ask.sagemath.org/question/37631/scale-axis-width1-and-height1/?comment=37636#post-id-37636