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.Mon, 07 Nov 2011 10:50:55 +0100polar_plot((1/sin(theta)),(theta, pi/12, pi/2))https://ask.sagemath.org/question/8428/polar_plot1sinthetatheta-pi12-pi2/In Sage notebook v 4.6.1 I wrote:
var('theta')
polar_plot((1/sin(theta)),(theta, pi/12, pi/2))
I got
libpng error: Image width or height is zero in IHDR
Traceback (click to the left of this block for traceback)
...
RuntimeError: Error building image
What am I doing wrong?Tue, 01 Nov 2011 20:57:13 +0100https://ask.sagemath.org/question/8428/polar_plot1sinthetatheta-pi12-pi2/Answer by Jason Grout for <p>In Sage notebook v 4.6.1 I wrote:</p>
<pre><code>var('theta')
polar_plot((1/sin(theta)),(theta, pi/12, pi/2))
</code></pre>
<p>I got</p>
<pre><code>libpng error: Image width or height is zero in IHDR
Traceback (click to the left of this block for traceback)
...
RuntimeError: Error building image
</code></pre>
<p>What am I doing wrong?</p>
https://ask.sagemath.org/question/8428/polar_plot1sinthetatheta-pi12-pi2/?answer=12849#post-id-12849I don't get an error, but I do get plots that are very stretched out. Even with
polar_plot((1/sin(theta)),(theta, pi/12, pi/2),aspect_ratio='auto')
the y-axis isn't as nice as when we do
plot(1,(x,0,3))
Tue, 01 Nov 2011 22:03:13 +0100https://ask.sagemath.org/question/8428/polar_plot1sinthetatheta-pi12-pi2/?answer=12849#post-id-12849Comment by kcrisman for <p>I don't get an error, but I do get plots that are very stretched out. Even with </p>
<pre><code>polar_plot((1/sin(theta)),(theta, pi/12, pi/2),aspect_ratio='auto')
</code></pre>
<p>the y-axis isn't as nice as when we do</p>
<pre><code>plot(1,(x,0,3))
</code></pre>
https://ask.sagemath.org/question/8428/polar_plot1sinthetatheta-pi12-pi2/?comment=20957#post-id-20957I was using 4.7.1, I think. Let me try... Yup, that part at least is fixed somewhere in 4.7.2.Fri, 04 Nov 2011 23:01:50 +0100https://ask.sagemath.org/question/8428/polar_plot1sinthetatheta-pi12-pi2/?comment=20957#post-id-20957Comment by Jason Grout for <p>I don't get an error, but I do get plots that are very stretched out. Even with </p>
<pre><code>polar_plot((1/sin(theta)),(theta, pi/12, pi/2),aspect_ratio='auto')
</code></pre>
<p>the y-axis isn't as nice as when we do</p>
<pre><code>plot(1,(x,0,3))
</code></pre>
https://ask.sagemath.org/question/8428/polar_plot1sinthetatheta-pi12-pi2/?comment=20965#post-id-20965I am running 4.7.2 alpha3, I think. What version are you running?Fri, 04 Nov 2011 14:15:36 +0100https://ask.sagemath.org/question/8428/polar_plot1sinthetatheta-pi12-pi2/?comment=20965#post-id-20965Comment by kcrisman for <p>I don't get an error, but I do get plots that are very stretched out. Even with </p>
<pre><code>polar_plot((1/sin(theta)),(theta, pi/12, pi/2),aspect_ratio='auto')
</code></pre>
<p>the y-axis isn't as nice as when we do</p>
<pre><code>plot(1,(x,0,3))
</code></pre>
https://ask.sagemath.org/question/8428/polar_plot1sinthetatheta-pi12-pi2/?comment=20981#post-id-20981Really, you don't get an error? Your polar plot command gives me `TypeError: can't multiply sequence by non-int of type 'float'`.Tue, 01 Nov 2011 22:04:23 +0100https://ask.sagemath.org/question/8428/polar_plot1sinthetatheta-pi12-pi2/?comment=20981#post-id-20981Answer by kcrisman for <p>In Sage notebook v 4.6.1 I wrote:</p>
<pre><code>var('theta')
polar_plot((1/sin(theta)),(theta, pi/12, pi/2))
</code></pre>
<p>I got</p>
<pre><code>libpng error: Image width or height is zero in IHDR
Traceback (click to the left of this block for traceback)
...
RuntimeError: Error building image
</code></pre>
<p>What am I doing wrong?</p>
https://ask.sagemath.org/question/8428/polar_plot1sinthetatheta-pi12-pi2/?answer=12848#post-id-12848This isn't a full answer, but I think that there is something wrong with how we are doing the axes for polar plot - probably because of our aspect ratio handling (?).
Compare
sage: polar_plot(1/sin(1.01*theta),(theta, pi/12,pi/2))
with
sage: polar_plot(1/sin(1.001*theta),(theta, pi/12,pi/2))
and you'll see what I mean.
This is now [Ticket 11978](http://trac.sagemath.org/sage_trac/ticket/11978).Tue, 01 Nov 2011 21:55:58 +0100https://ask.sagemath.org/question/8428/polar_plot1sinthetatheta-pi12-pi2/?answer=12848#post-id-12848Answer by Bill Page _ again for <p>In Sage notebook v 4.6.1 I wrote:</p>
<pre><code>var('theta')
polar_plot((1/sin(theta)),(theta, pi/12, pi/2))
</code></pre>
<p>I got</p>
<pre><code>libpng error: Image width or height is zero in IHDR
Traceback (click to the left of this block for traceback)
...
RuntimeError: Error building image
</code></pre>
<p>What am I doing wrong?</p>
https://ask.sagemath.org/question/8428/polar_plot1sinthetatheta-pi12-pi2/?answer=12822#post-id-12822Thanks for the trac ticket.
Here is another one with a problem:
polar_plot(3*sqrt(cos(2*theta)),(theta, 0, 2*pi))
gives the follow graph:
> ![image description](http://)
>
> Sorry, file uploading requires karma > 60
Arrrgh!
Well, ok try it yourslf. On my v.4.6.1 worksheet I see a plot with some weird discontinuity near the origin.
Fri, 04 Nov 2011 11:08:55 +0100https://ask.sagemath.org/question/8428/polar_plot1sinthetatheta-pi12-pi2/?answer=12822#post-id-12822Comment by kcrisman for <p>Thanks for the trac ticket.</p>
<p>Here is another one with a problem:</p>
<pre><code>polar_plot(3*sqrt(cos(2*theta)),(theta, 0, 2*pi))
</code></pre>
<p>gives the follow graph:</p>
<pre><code>> ![image description](http://)
>
> Sorry, file uploading requires karma > 60
</code></pre>
<p>Arrrgh!</p>
<p>Well, ok try it yourslf. On my v.4.6.1 worksheet I see a plot with some weird discontinuity near the origin.</p>
https://ask.sagemath.org/question/8428/polar_plot1sinthetatheta-pi12-pi2/?comment=20951#post-id-20951Yeah, but that's ok. I mean, you should have gotten that error for the one without the `plot_points` option set as well. That is because you are plugging in `theta` that give you a negative number inside the square root :) and plot ignores them but tells you that some of its points did that.Mon, 07 Nov 2011 10:50:55 +0100https://ask.sagemath.org/question/8428/polar_plot1sinthetatheta-pi12-pi2/?comment=20951#post-id-20951Comment by kcrisman for <p>Thanks for the trac ticket.</p>
<p>Here is another one with a problem:</p>
<pre><code>polar_plot(3*sqrt(cos(2*theta)),(theta, 0, 2*pi))
</code></pre>
<p>gives the follow graph:</p>
<pre><code>> ![image description](http://)
>
> Sorry, file uploading requires karma > 60
</code></pre>
<p>Arrrgh!</p>
<p>Well, ok try it yourslf. On my v.4.6.1 worksheet I see a plot with some weird discontinuity near the origin.</p>
https://ask.sagemath.org/question/8428/polar_plot1sinthetatheta-pi12-pi2/?comment=20966#post-id-20966This is a different issue that is not really solvable in the same way. Try `polar_plot(3*sqrt(cos(2*theta)),(theta, 0, 2*pi),plot_points=50000)` for something that looks pretty good, though.Fri, 04 Nov 2011 12:52:23 +0100https://ask.sagemath.org/question/8428/polar_plot1sinthetatheta-pi12-pi2/?comment=20966#post-id-20966Comment by Bill Page _ again for <p>Thanks for the trac ticket.</p>
<p>Here is another one with a problem:</p>
<pre><code>polar_plot(3*sqrt(cos(2*theta)),(theta, 0, 2*pi))
</code></pre>
<p>gives the follow graph:</p>
<pre><code>> ![image description](http://)
>
> Sorry, file uploading requires karma > 60
</code></pre>
<p>Arrrgh!</p>
<p>Well, ok try it yourslf. On my v.4.6.1 worksheet I see a plot with some weird discontinuity near the origin.</p>
https://ask.sagemath.org/question/8428/polar_plot1sinthetatheta-pi12-pi2/?comment=20953#post-id-20953Ok, yes with this option I do get a reasonable looking graph but I also get the message:
verbose 0 (3998: plot.py, generate_plot_points) WARNING: When plotting,
failed to evaluate function at 24999 points.
verbose 0 (3998: plot.py, generate_plot_points) Last error message: ''Mon, 07 Nov 2011 07:37:49 +0100https://ask.sagemath.org/question/8428/polar_plot1sinthetatheta-pi12-pi2/?comment=20953#post-id-20953