-
-
Notifications
You must be signed in to change notification settings - Fork 490
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_plot3d plots extraneous points at z=0 and doesn't take color or rgbcolor as keywords #12798
Comments
This comment has been minimized.
This comment has been minimized.
Author: Punarbasu Purkayastha |
Changed keywords from list_plot3d to list_plot3d, sd40.5 |
comment:3
I like this idea, but have a couple questions.
|
comment:4
Replying to @kcrisman:
Actually,
Does that sound reasonable?
I have no idea why this was done. Was it some bug in matplotlib earlier? Was it just an oversight? For an empty plot, I suppose you would not want there to be plot points at 0.0! |
Reviewer: Karl-Dieter Crisman |
comment:5
Sorry for the inaccuracy, of course that is what I meant.
Yes, as long as we document it. We do similar things lots of other places.
Hmm, looking at your plots from the post, I think I know. The idea was probably to have the |
comment:6
Updated the patch. |
comment:7
Okay, I think this idea is okay. William says to defer to what Mathematica appears to do, since this is where the function was inspired, many years ago.
And see here, the second example - clearly not continued beyond the three points given. But I can't get it to work.
None of these really seemed to look like what I wanted, or even sometimes to have anything plot. Am I using this incorrectly? |
comment:8
There seems to be a problem with the colors here. This is a bug that is present even without my patch. It seems like the texture is not passed onto the final function which plots the line.
Can you check these with the additional arguments |
Apply to |
comment:9
Attachment: trac_12798-fix_extraneous_points_and_kwds_in_list_plot3d.patch.gz Ok. I updated the patch to fix the color in 3D lines. The other problem with interpolation and |
comment:10
Great, color works now - nice catch. It turns out that the documentation for what this function actually does is insanely bad. I'm going to upload a patch clarifying what it actually does, which is not intuitive at all. As for the issue you are seeing, I think it's very interesting. Notice that the box that comes up does have the right dimensions to incorporate all three points, even when you don't specify Here is what is going on - I've printed out the
So you pick your poison here. Either you get something that does have the right points, but then also has everything else be extended by zero, or you don't do that, but the algorithm fails in certain cases. This will happen whenever the "box" in question is a lot bigger than the projection of the actual points to the xy-plane.
I'm good with your work. If you like my changes, sign off as a reviewer and we'll get this in. |
comment:11
Patchbot: Apply trac_12798-fix_extraneous_points_and_kwds_in_list_plot3d.patch and trac_12798-more-doc.patch. |
Changed author from Punarbasu Purkayastha to Punarbasu Purkayastha, Karl-Dieter Crisman |
This comment has been minimized.
This comment has been minimized.
only added #long time to last example |
Changed reviewer from Karl-Dieter Crisman to Karl-Dieter Crisman, Punarbasu Purkayastha |
comment:12
Attachment: trac_12798-more-doc.2.patch.gz Your patch looks good. The documentation was indeed lacking. I added just one small comment (# long time) in the last example in your patch. Positive review from me. |
comment:41
I guess the method Because now we are sending a list of faces to be plotted full of
I think this is a true bug (and this might even have been the reason for the old |
comment:42
Replying to @kcrisman:
I had a look at the files. For 3D plot, the |
apply after the earlier patches |
comment:43
Attachment: trac_12798-dont_pass_nan_to_ParametricSurface.patch.gz @jdemeyer: can you test the new patch I have put up. I prevent Why I opted for this - modifying
But doing so implies that we also need to modify It seemed better/safer to actually modify |
comment:44
That extra patch doesn't seem to have changed anything. You can check for yourself with:
There should be no I'm afraid this will need some more substantial work. |
This comment has been minimized.
This comment has been minimized.
Changed reviewer from Karl-Dieter Crisman, Punarbasu Purkayastha to Karl-Dieter Crisman, Punarbasu Purkayastha, Jeroen Demeyer |
comment:45
...although, strangely enough, the doctest timeout is gone on Solaris with that patch. I'm still not happy with this patch because of the Somebody still needs to test the patch and check whether the output 3D plots still look like they should. |
comment:46
Yeah, I have to say that I'd be happier if this change was somehow doctested. Is there any place where we can document that the |
comment:47
Replying to @kcrisman:
|
comment:48
Replying to @kcrisman:
In fact, I don't know what you mean with "visibly disappeared". |
comment:49
Oh. What I mean is that we should be able to have a doctest that would have once output a list with some |
comment:50
Replying to @jdemeyer:
I had a fresh look at this ticket. The last patch that I posted which trims the
The output is a square instead of a triangle and the square persists even for As for the presence of So, every time the ranges of So now, the question is, why does At this point, what I suggest is to merge the changes regarding the colors, and leave the |
comment:51
Replying to @ppurka:
I completely disagree with this. At the end, you're drawing an arbitrary 3D figure given by faces and vertices. This doesn't have to lie over a square grid. Of course, currently the functions are written to require a square grid, but there is no fundamental reason for this. I agree it's not trivial to change this, but don't blame Solaris. |
comment:52
Nan is the standard to denote missing floating point values and should be used. It is IEEE standard and perfectly portable across all architectures where you can reasonably expect to get an accurate answer for floating point operations. Having said that, the special IEEE floating point values (nan, inf, subnormal) have sometimes been extremely slow on ancient processor architectures. For example, see http://www.sonic.net/~jddarcy/Research/fleckmrk.pdf tests an older ultrasparc and finds that nan and inf are fine, but subnormal can be more than three orders of magnitude slower. On the plus side, modern processors don't really suffer from these childhood diseases any more and it is generally preferable to use IEEE propagation of nans through floating point operations than riddle your code with if/else and the ensuing pipeline stalls. So if the only problem with this ticket is that SPARC is slow then lets just reduce the number of points (doesn't really add anything new to the doctest anyways) and ship it. |
comment:53
Replying to @vbraun:
Seriously, you're arguing that rendering 3D figures with NaN coordinates is a good thing? I find it hard to believe that rendering a figure with 2000 faces (half of which aren't drawn due to NaNs) is faster than first removing the offending faces and rendering a figure with 1000 faces. |
comment:54
If most of the points are invalid then you should of course use a different base grid, but I think thats not the scope of this ticket. The way I understand it, this ticket is about a fast rectangular base grid that doesn't fall flat on its face if there is a pole somewhere. |
comment:55
Replying to @jdemeyer:
I haven't looked at if it is Sage which is doing the rendering. But if Sage is trying to actually plot/render the points - the nans are specific 3D points Note that we are not generating the grid - the grid is being provided by mpl after interpolation. Anyway, the slowdown is architecture specific (there's speedups on intel, as I mentioned before) and triggered only on doctest mode; and if you would like it to stay that way then so be it. Only reasonable way to fix |
comment:56
@jdemeyer The doctest system has changed since this ticket was opened. So can you apply |
list_plot3d
plots extra points at the horizontal x-y plane. This seems to stem from the default value of 0.0 that is assigned in the code. See this post.This function also does not take in
color
orrgbcolor
as keywords. Rest of the plot commands includingplot
,list_plot
,plot3d
do take in these keywords.First attached patch fixes both these problems, second one fixes more doc and clarifies output.
Apply attachment: trac_12798-fix_extraneous_points_and_kwds_in_list_plot3d.patch, attachment: trac_12798-more-doc.3.patch and attachment: trac_12798-dont_pass_nan_to_ParametricSurface.patch to
devel/sage
.CC: @kcrisman
Component: graphics
Keywords: list_plot3d, sd40.5
Author: Punarbasu Purkayastha, Karl-Dieter Crisman
Reviewer: Karl-Dieter Crisman, Punarbasu Purkayastha, Jeroen Demeyer
Issue created by migration from https://trac.sagemath.org/ticket/12798
The text was updated successfully, but these errors were encountered: