-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
3D Stem Plot #6271
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
3D Stem Plot #6271
Conversation
Please check the PEP8 build for the PEP8 issues that need to be fixed. |
This is very interesting, and I like how it comes with unit tests, examples, and documentation. There are some issues that will need to be resolved first, but this is a neat first step. First, do fix the PEP8 issues. Second, please follow the naming conventions of the other functions. "stem3" does not follow that convention. Third, the art3d module has Fourth, this will need a "whats_new" entry. Fifth, and it might not be able to get addressed this time around. Because of the way you build the StemContainer, and because of an inherent limitation of mplot3d, there are what I call "Escher Effects" in the plot. Look closely at the red circle in your example. It appears to be in front of all the stems. This could probably be partly mitigated by constructing the baseline first, then the stems. |
@WeatherGod Thanks for reviewing our changes! We have updated our code to address most of the changes you suggested, including the pep8 issues, naming conventions, whats_new entry, and the "Escher Effects". Re Escher Effects: We've modified the code so that the baselines are drawn before the stem lines, and it seems to have improved the image somewhat. Re We expect to have the changes committed sometime after the 18th (due to exams!). We hope that's alright. |
No problem. This wouldn't be able to go in until version 2.1 anyway. Feel free to push up any updates you have so far so that we can comment on it. At the end, we will likely need to do a squash rebase so that we don't have multiple commits of the baseline images. |
e6456cb
to
a9878ec
Compare
@WeatherGod Hi again. Our team has made a few commits to address your suggestions from before. We have made the following changes:
Here is the original image (for reference): We have updated all relevant demos, unit tests, and docstrings as a result of these modifications. Please review our changes when you get the chance. Thanks once again for your suggestions! |
#plot the baseline in the appropriate plane | ||
for i in range(len(x)-1): | ||
|
||
baseline, = Axes.plot(self, [x[i], x[i+1]], [y[i], y[i+1]], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probabyl better to use a LineCollection
here. Or at least directly create artist.Line2D
.
You should also set the color here to eliminate the need for the setp
calls in your examples and tests.
This looks to be an abandoned student project, but if someone wanted to take it up, it looks like it is mostly done.... |
These are somewhat like the original tests in matplotlib#6271, but consolidated into fewer images, and testing more properties.
This is too old to push a rebase or further work; I've done so in a new PR #18310. |
These are somewhat like the original tests in matplotlib#6271, but consolidated into fewer images, and testing more properties.
These are somewhat like the original tests in matplotlib#6271, but consolidated into fewer images, and testing more properties.
These are somewhat like the original tests in matplotlib#6271, but consolidated into fewer images, and testing more properties.
These are somewhat like the original tests in matplotlib#6271, but consolidated into fewer images, and testing more properties.
These are somewhat like the original tests in matplotlib#6271, but consolidated into fewer images, and testing more properties.
These are somewhat like the original tests in matplotlib#6271, but consolidated into a single image, and testing more properties.
These are somewhat like the original tests in matplotlib#6271, but consolidated into a single image, and testing more properties.
This PR implements 3D Stem Plots.
Hi! We are a team of five students at the University of Toronto. As a part of our course requirements, we have implemented a new feature for mpl - 3D Stem Plots. We think this feature is useful because it will allow users to create models for more complex data (e.g. Stem plots can be used to track particle motion by providing z axis information).
We tested our implementation and are able to produce most of the graphs in this link from MATLAB: http://www.mathworks.com/help/matlab/ref/stem3.html
Note: Due to time constraints, we decided to implement this function so that it requires 3 mandatory arguments: x, y, and z, which are arrays of the same length.
We have included a demo file to demonstrate how our function works. For example, examples/mplot3d/stem3_demo.py contains the following script:
Running this script will produce the following graph:
@samriddhikaushik @KanwarGill @zqliang @alveejamal