Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list_plot plots y-values on x-axis when a value is None #29960

Open
rburing opened this issue Jun 24, 2020 · 3 comments · May be fixed by #39481
Open

list_plot plots y-values on x-axis when a value is None #29960

rburing opened this issue Jun 24, 2020 · 3 comments · May be fixed by #39481

Comments

@rburing
Copy link
Contributor

rburing commented Jun 24, 2020

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.)

Component: graphics

Keywords: list_plot, None

Issue created by migration from https://trac.sagemath.org/ticket/29960

@rburing rburing added this to the sage-9.2 milestone Jun 24, 2020
@mkoeppe
Copy link
Contributor

mkoeppe commented Oct 24, 2020

comment:1

Attachment: list_plot_x-axis.png

@mkoeppe mkoeppe modified the milestones: sage-9.2, sage-9.3 Oct 24, 2020
@mkoeppe
Copy link
Contributor

mkoeppe commented Apr 7, 2021

comment:2

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

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 Apr 7, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Aug 22, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Dec 18, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 May 3, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Sep 19, 2022
@mkoeppe mkoeppe removed this from the sage-9.8 milestone Jan 29, 2023
@Noel-Roemmele
Copy link
Contributor

Dave Morris has assigned this to me to be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants