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
Discrete spikes in surface plot when not in data #10897
Comments
Possible Solution However, I am still curious to why this addition is required, and if there is a work around for 'cmap=cm.jet' giving an error when it seems to still work? I cannot run the code in VisualStudio with the error, but it works fine in PyCharm. Thanks! Code for reproduction surf = ax.plot_surface(X, Y, Z, cmap=cm.jet, rstride=1, cstride=1, edgecolor='black') New Plots |
The main issue that you solved is probably just due to that the default sampling/interpolation that is used in the 3d ploting where to coarse for your data. rcount=100, ccount=100 also seems to work. cmap=cm.jet works for me in python 3.6 and matplotlib 2.1.1 but cmap='jet' also works and might be a work around |
Could you elaborate on this? |
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help! |
The source of the problem is that by default we down-sample the input data to 50 x 50 via slicing (pre 2.0 we down-sampled by a factor of 10 in all cases by default) which is to ensure that if the user passes us a 2kx2k set of data we do not have un-bounded run time for images that end up render as all This data is also particularly difficult because the features are exactly 1 element wide and 0 else where. Setting I think the "fix" here is to force every "joint" in the mesh to actually be a quad vertex, but that means that we have to make a choice about which user input to ignore (as the user passes us data with a shape, if they then pass both I would like @scottshambaugh 's input on if this is something we should just accept as the way it is or if there is a path to actually fix this? (also, @scottshambaugh recent improvements to the interactivity of mplot3D made this easier to debug!) |
Bug report
Bug summary
Surface plot has discrete spikes down the x-axis (rows) when they should look more like fins. This changes depending on the range of the y-axis (number of columns). See the two figures below. Everything appears as smooth "fins" when the data is plotted in matlab. I did try playing around with rstride, cstride, rcount, and ccount listed in https://matplotlib.org/mpl_toolkits/mplot3d/tutorial.html but I did not get any where.
I am also getting an error with 'cmap=cm.jet' but it seems to work anyways.
Any help would be appreciated as I am trying to move to python and away from matlab, but I need to be able to create various figures. Thank you.
Code for reproduction
Actual outcome
Expected outcome
I am expecting nice fins for all the data similar to the second figure. If you look carefully you can see there are some of the discrete impulses in that figure too though. None of the discrete impulses appear when I plot the data in matlab, everything looks like a fin.
Matplotlib version
print(matplotlib.get_backend())
): Qt5AggEverything was installed from anaconda.
The text was updated successfully, but these errors were encountered: