#32578 closed defect (fixed)

Allow for coordinate changes in curve plots

Reported by: Eric Gourgoulhon Owned by:
Priority: major Milestone: sage-9.5
Component: manifolds Keywords: curve, plot
Cc: Travis Scrimshaw, Michael Jung, Matthias Köppe Merged in:
Authors: Eric Gourgoulhon Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: 5ac0f28 (Commits, GitHub, GitLab) Commit: 5ac0f28559ab278a19833beb28761207fa1a2174
Dependencies: Stopgaps:

Status badges


In Sage 9.5.beta2, the following attempt to plot a cardioid fails:

sage: E.<r,ph> = EuclideanSpace(coordinates='polar')
sage: c = E.curve((1 + cos(ph), ph), (ph, 0, 2*pi))
sage: c.plot(chart=E.cartesian_coordinates())
ValueError: No expression has been found for Curve in the Euclidean plane E^2
 in terms of Chart (E^2, (x, y))

This is because the curve c is known only in polar coordinates and no attempt is made to compute its expression in terms of Cartesian coordinates. Forcing the latter computation by e.g.

sage: c.display(chart2=E.cartesian_coordinates())

before invoking c.plot(chart=E.cartesian_coordinates()) makes things work.

In the current ticket, the method plot is modified, so that the expression in the coordinates specified by the argument chart is computed by means of ContinuousMap.coord_functions. Moreover, this simplifies significantly the code of DifferentiableCurve.plot.

Change History (4)

comment:1 Changed 14 months ago by Eric Gourgoulhon

Branch: public/manifolds/curve_plot-32578
Cc: Travis Scrimshaw Michael Jung Matthias Köppe added
Commit: 5ac0f28559ab278a19833beb28761207fa1a2174
Status: newneeds_review

New commits:

5ac0f28Allow for coordinate changes in curve plots (Trac #32578)

comment:2 Changed 14 months ago by Travis Scrimshaw

Reviewers: Travis Scrimshaw
Status: needs_reviewpositive_review


comment:3 Changed 14 months ago by Eric Gourgoulhon

Thank you for the review!

comment:4 Changed 14 months ago by Volker Braun

Branch: public/manifolds/curve_plot-325785ac0f28559ab278a19833beb28761207fa1a2174
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.