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

Allow plotting zero width interval #12881

Open
kcrisman opened this issue Apr 25, 2012 · 4 comments
Open

Allow plotting zero width interval #12881

kcrisman opened this issue Apr 25, 2012 · 4 comments

Comments

@kcrisman
Copy link
Member

plot(x,x,0,0)
       	
Traceback (click to the left of this block for traceback)
...
ValueError: plot start point and end point must be different

Maybe this shouldn't be an error, but instead give an empty plot or a point? See below for discussion.

Component: graphics

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

@kini
Copy link
Collaborator

kini commented Apr 25, 2012

comment:1

See #11753, which should have fixed this.

@kini
Copy link
Collaborator

kini commented Apr 25, 2012

comment:2

Indeed I cannot reproduce this on Sage 5.0.beta13.

@kcrisman

This comment has been minimized.

@kcrisman
Copy link
Member Author

comment:3

Oh, and this is clearly a dup and invalid as it stands, because I was using our old campus server. Nice!

But I'm going to change this. I wonder if this maybe shouldn't give rise to an empty graphic, or maybe just a point. The reason is that in the wild, one can't always predict what one will want. As an example:

var('y')
@interact
def _(t = [pi/6*n for n in [1..18]]):
    P = plot(1/2*sin(y),(x,0,t),fill=True,tick_formatter=pi,ticks=pi/6)
    Q = plot(1/2*sin(y),(x,0,3*pi),tick_formatter=pi,ticks=pi/6)
    show(P+Q)
    html("The integral up to $y=%s$ is $\\approx %s$."%(latex(t),latex(integral(1/2*sin(y),y,0,t).n())))

I would really like to have it be from [0..18], since I already have a plot and it would be nice to have this work since integration from 0 to 0 works - but this error stands in the way.

@kcrisman kcrisman changed the title Plotting zero interval raises dumb error Allow plotting zero width interval Apr 25, 2012
@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@mkoeppe mkoeppe removed this from the sage-6.4 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants