Opened 13 years ago

Closed 13 years ago

#1778 closed defect (fixed)

[with patch, positive review] plot() does not follow the same interval range conventions as plot3d()

Reported by: moretti Owned by: moretti
Priority: major Milestone: sage-2.10
Component: graphics Keywords: plotting, plot3d, plot
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by mabshoff)

sage: plot3d(x^2 + y^2, (x,-2,2), (y,-2,2))

is valid, however, to do a 2d plot, you use the syntax

sage: plot(x^2, x, -2, 2).

I spoke with William about this, he wants to deprecate the plot(x^2, -2, 2) syntax for 2d plotting and introduce a new preferred syntax:

sage: plot(x^2, (x, -2, 2))

Attachments (3)

plot.patch (758 bytes) - added by moretti 13 years ago.
plot.hg (5.3 KB) - added by moretti 13 years ago.
trac-1778-referee.patch (4.7 KB) - added by was 13 years ago.
apply the hg bundle that bobby posted, then apply this plain text patch which fixes one serious bug.

Download all attachments as: .zip

Change History (11)

Changed 13 years ago by moretti

comment:1 Changed 13 years ago by moretti

Ignore the previous patch, it does not have all the required changes.

Changed 13 years ago by moretti

comment:2 Changed 13 years ago by moretti

  • Summary changed from plot() does not follow the same interval range conventions as plot3d() to [with patch] plot() does not follow the same interval range conventions as plot3d()

I implemented this in the attached. It makes both the old and new style of plot() syntax valid. However the documentation mentions that plot(x2, (x, a, b)) is the preferred syntax. Please test it out.

comment:3 Changed 13 years ago by was

  • Milestone set to sage-2.10
  • Priority changed from minor to major

That this doesn't work anymore is definitely a bug:

sage: plot(sin(2), (x,0,10*pi))
BOOM!

Likewise for

sage: plot(sin(2), 0,10*pi)
BOOM

I'll try to fix this....

comment:4 Changed 13 years ago by was

It turns out the plot(sin(2), (x,0,10*pi)) problem above was a really genuine bug coming from an indentation mistake on line 624 (I will attach a patch fixing this and other issues).

Changed 13 years ago by was

apply the hg bundle that bobby posted, then apply this plain text patch which fixes one serious bug.

comment:5 Changed 13 years ago by was

  • Summary changed from [with patch] plot() does not follow the same interval range conventions as plot3d() to [with patch, positive review] plot() does not follow the same interval range conventions as plot3d()

Apply the plot.hg followed by trac-1778-referee.patch

comment:6 Changed 13 years ago by mabshoff

  • Description modified (diff)

comment:7 Changed 13 years ago by mabshoff

I had to resolve some slight merge conflict with #1779 in setup.py.

Cheers,

Michael

comment:8 Changed 13 years ago by mabshoff

  • Resolution set to fixed
  • Status changed from new to closed

Merged in Sage 2.10.alpha3

Note: See TracTickets for help on using tickets.