sagemath / sage

Main repository of SageMath. Now open for Issues and Pull Requests.
https://www.sagemath.org
Other
1.15k stars 405 forks source link

fill option is broken for polar_plot #6875

Closed a8806e44-c4d4-4baf-918e-1f2679b05e2d closed 14 years ago

a8806e44-c4d4-4baf-918e-1f2679b05e2d commented 14 years ago

The fill option for polar_plot does not work correctly anymore.

The following two doctests don't produce the supposed output:

sage: polar_plot(cos(4*x) + 1.5, 0, 2*pi, fill=0.5 * cos(4*x) + 2.5, fillcolor='orange').show(aspect_ratio=1)
sage: polar_plot([(1.2+k*0.2)*log(x) for k in range(6)], 1, 3 * pi, fill = {0: [1], 2: [3], 4: [5]})

This regression has been introduced with the changeset 12287 (Ticket: #5930).

Sage really needs a test framework for plots. Otherwise more and more regressions will creep in, without anybody noticing.

Component: graphics

Keywords: polar_plot, fill

Author: Wilfried Huss

Reviewer: Jason Grout

Merged: Sage 4.1.2.alpha2

Issue created by migration from https://trac.sagemath.org/ticket/6875

a8806e44-c4d4-4baf-918e-1f2679b05e2d commented 14 years ago

Attachment: trac_6875_fill_regression.patch.gz

jasongrout commented 14 years ago
comment:1

It still doesn't seem like the first example above works for me---I get a single solid figure. Is it supposed to have a band around it's edge?

a8806e44-c4d4-4baf-918e-1f2679b05e2d commented 14 years ago

Attachment: polar_1.png

The correct output of the first example

a8806e44-c4d4-4baf-918e-1f2679b05e2d commented 14 years ago

Attachment: polar_2.png

The correct output of the second example

a8806e44-c4d4-4baf-918e-1f2679b05e2d commented 14 years ago
comment:2

Replying to @jasongrout:

It still doesn't seem like the first example above works for me---I get a single solid figure. Is it supposed to have a band around it's edge?

I've attached two images with the correct output of the two examples. Is this what you get with the patch?

jasongrout commented 14 years ago
comment:3

I compiled a fresh version of 4.1.1.alpha1 overnight, and everything seems to work on that. So positive review!

(Note to everyone else: the functions above were already in the doctests, but just were not working).

I wish this would have been working last week when I taught finding areas in polar coordinates! I'm glad you found the fix.

7c09a680-e216-4024-bb8e-9bfd4aa7f313 commented 14 years ago

Changed author from whuss to Wilfried Huss

7c09a680-e216-4024-bb8e-9bfd4aa7f313 commented 14 years ago
comment:4

Merged trac_6875_fill_regression.patch.

7c09a680-e216-4024-bb8e-9bfd4aa7f313 commented 14 years ago

Merged: Sage 4.1.2.alpha2

7c09a680-e216-4024-bb8e-9bfd4aa7f313 commented 14 years ago

Reviewer: Jason Grout