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:

Status badges

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)

list_plot_x-axis.png (7.1 KB) - added by Ricardo Buring 2 years ago.

Download all attachments as: .zip

Change History (7)

Changed 2 years ago by Ricardo Buring

Attachment: list_plot_x-axis.png added

comment:1 Changed 2 years ago by Matthias Köppe

Milestone: sage-9.2sage-9.3

comment:2 Changed 18 months ago by Matthias Köppe

Milestone: sage-9.3sage-9.4

Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review.

comment:3 Changed 13 months ago by Matthias Köppe

Milestone: sage-9.4sage-9.5

comment:4 Changed 10 months ago by Matthias Köppe

Milestone: sage-9.5sage-9.6

comment:5 Changed 5 months ago by Matthias Köppe

Milestone: sage-9.6sage-9.7

comment:6 Changed 10 days ago by Matthias Köppe

Milestone: sage-9.7sage-9.8
Note: See TracTickets for help on using tickets.