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

Sage's plot3d() does not accurately depict the domain #10215

Open
sagetrac-drkirkby mannequin opened this issue Nov 4, 2010 · 8 comments
Open

Sage's plot3d() does not accurately depict the domain #10215

sagetrac-drkirkby mannequin opened this issue Nov 4, 2010 · 8 comments

Comments

@sagetrac-drkirkby
Copy link
Mannequin

sagetrac-drkirkby mannequin commented Nov 4, 2010

Following a request to test the following 3 lines of code on #8433

y=var('y')
B=plot3d(sqrt(sin(x)*sin(y)),(x,-2*pi,2*pi),(y,-2*pi,2*pi),viewer='tachyon')
B.show()

I did this on Sage 4.5.1 running on Solaris 10 and found no problems of excessive CPU time as reported at #8433. However, the quality of the output leaves a lot to be desired, and appears to show discontinuities which are not in the function.

Attached are two images showing the output from Sage using

y=var('y')
B=plot3d(sqrt(sin(x)*sin(y)),(x,-2*pi,2*pi),(y,-2*pi,2*pi),viewer='tachyon')
B.show()

and Mathematica 7.0.1 using the following command

Plot3D[Sqrt[Sin[x] Sin[y]],{x,-2 Pi, 2 Pi},{y, - 2 Pi, 2 Pi}] 

Whilst Mathematica's output is obviously more asetically pleasing, with the false colour, the main problem with the Sage output is that it shows discontinuities which simply should not exist in the function being plotted. (Obviously, for some values of x and y, the square root of a negative number is taken, so the plots do not show this. However, the transition to this point should be smooth, like in the Mathematica

It would be good if we could improve this. Jason Grout had some idea what the problem probably is.

http://groups.google.com/group/sage-devel/browse_thread/thread/7476ecc5d4e83caf?hl=en

saying

*I think the problem is that in Sage, we do not try to break up plotting triangles to find out the actual boundaries of a domain. Instead, we just try to plot the triangle that goes across the domain boundary, find that one corner of the triangle is off the domain, and so we don't plot the triangle. *

Related tickets #8433

CC: @jasongrout @robert-marik @robertwb @sagetrac-mhampton @sagetrac-mvngu

Component: graphics

Keywords: plot3d

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

@sagetrac-drkirkby sagetrac-drkirkby mannequin added this to the sage-5.11 milestone Nov 4, 2010
@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Nov 4, 2010

Attachment: sage-plot3d-sinx-siny.png

Plot produced by Sage 4.5.1 using plot3d(sqrt(sin(x)sin(y)),(x,-2pi,2pi),(y,-2pi,2*pi),viewer='tachyon')

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Nov 4, 2010

Plot produced by Mathematica 7.0.1 using Plot3D[Sqrt[Sin[x] Sin[y]],{x,-2 Pi, 2 Pi},{y, - 2 Pi, 2 Pi}]

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Nov 4, 2010

comment:2

Attachment: Plot3D-in-Mathematica-of-sqrt-sin-x-sin-y.png

@sagetrac-drkirkby

This comment has been minimized.

@sagetrac-drkirkby

This comment has been minimized.

@jasongrout
Copy link
Member

comment:4

I made the topic of the ticket much more descriptive of the problem pointed out. If you'd like to open another ticket for another specific issue, feel free!

@jasongrout jasongrout changed the title Sage's plot3d() is very poor compared to Mathematica's Plot3D[] Sage's plot3d() does not accurately depict the domain Nov 4, 2010
@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Nov 5, 2010

comment:5

Replying to @jasongrout:

I made the topic of the ticket much more descriptive of the problem pointed out. If you'd like to open another ticket for another specific issue, feel free!

That's fine by me.

@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
@fchapoton
Copy link
Contributor

Changed keywords from none to plot3d

@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

5 participants