Opened 8 months ago

Closed 7 months ago

#32578 closed defect (fixed)

Allow for coordinate changes in curve plots

Reported by: egourgoulhon Owned by:
Priority: major Milestone: sage-9.5
Component: manifolds Keywords: curve, plot
Cc: tscrim, gh-mjungmath, mkoeppe 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

Description

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 8 months ago by egourgoulhon

  • Branch set to public/manifolds/curve_plot-32578
  • Cc tscrim gh-mjungmath mkoeppe added
  • Commit set to 5ac0f28559ab278a19833beb28761207fa1a2174
  • Status changed from new to needs_review

New commits:

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

comment:2 Changed 8 months ago by tscrim

  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review

LGTM.

comment:3 Changed 8 months ago by egourgoulhon

Thank you for the review!

comment:4 Changed 7 months ago by vbraun

  • Branch changed from public/manifolds/curve_plot-32578 to 5ac0f28559ab278a19833beb28761207fa1a2174
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.