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

(x==17).subs(x=19).plot() plots a line at height 2 #22829

Open
pelegm opened this issue Apr 19, 2017 · 2 comments
Open

(x==17).subs(x=19).plot() plots a line at height 2 #22829

pelegm opened this issue Apr 19, 2017 · 2 comments

Comments

@pelegm
Copy link
Contributor

pelegm commented Apr 19, 2017

(x==17).subs(x=19).plot()

plots a line at height 2. In general, replacing 17 with a and 19 with b results in a line at height b-a.

This is of course silly, as if one wishes to plot the function a == b, it should probably be at height 1 if indeed a=b, or at height 0 otherwise.

Component: symbolics

Keywords: bool, expression, plot

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

@pelegm pelegm added this to the sage-8.0 milestone Apr 19, 2017
@pelegm
Copy link
Contributor Author

pelegm commented Apr 19, 2017

comment:1

Perhaps related:

(x==17).plot()

plots the same line as

(x-17).plot()

@kcrisman
Copy link
Member

comment:2

Perhaps related:

(x==17).plot()

plots the same line as

(x-17).plot()

This at least is not a bug. Sage should plot the same thing for x^2+1 and x^2+1==0, if it plots anything at all, as in other contexts they are considered the same. However, I'm not sure if anything should be plotted here.

See https://github.com/sagemath/sage-prod/blob/master/src/sage/symbolic/expression.pyx#L11388 for where this is defined. This is very old code, so it may take some work to get right. Note that the subs you point out gives 19 == 17 which then https://github.com/sagemath/sage-prod/blob/master/src/sage/ext/fast_callable.pyx interprets as 2.

But I don't know that I'd interpret 19==17 as either 1 or 0, as we don't plot truth values, we plot numbers.

@mkoeppe mkoeppe removed this from the sage-8.0 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

3 participants