Opened 2 years ago
Last modified 10 days ago
#29960 new defect
list_plot plots y-values on x-axis when a value is None
Reported by: | Ricardo Buring | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-9.8 |
Component: | graphics | Keywords: | list_plot, None |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
The error handling in list_plot
is dubious, with the following incredible side effect:
list_plot([(0,-1),(1,-2),(2,-3),(3,-4),(4,None)])
What happens is that list_plot
eventually calls point
which raises a TypeError
due to the None
, and then list_plot
assumes that it was because the input consists of complex numbers (which is not the reason), and further it assumes that the input data
has already been replaced by list(enumerate(data))
by the previous code (which isn't the case), so it takes the second entry of each pair and converts it into an element of CC
and plots that. Hence the y-values are plotted on the x-axis. (And the None
is converted to 0
.)
Attachments (1)
Change History (7)
Changed 2 years ago by
Attachment: | list_plot_x-axis.png added |
---|
comment:1 Changed 2 years ago by
Milestone: | sage-9.2 → sage-9.3 |
---|
comment:2 Changed 18 months ago by
Milestone: | sage-9.3 → sage-9.4 |
---|
comment:3 Changed 13 months ago by
Milestone: | sage-9.4 → sage-9.5 |
---|
comment:4 Changed 10 months ago by
Milestone: | sage-9.5 → sage-9.6 |
---|
comment:5 Changed 5 months ago by
Milestone: | sage-9.6 → sage-9.7 |
---|
comment:6 Changed 10 days ago by
Milestone: | sage-9.7 → sage-9.8 |
---|
Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review.