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
Feature Requestion: filled step plot #1709
Comments
This sounds like a bug to me, as Eric says in the mailing list:
|
I tried to solve this issue, but there some small refactoring in Lines2D is necessary: Also while studying the code, i found the following lines:
Are the last two lines not redundant? (But i don't know matplotlib interals good enough to be sure.) |
A easier solution would be to just add a get_drawn_path method, which returns "real" path (and if necessary calculates it). The step-calculation function would be shared with the draw methods. |
We fixed this as part of a group assignment on my CS course. We did a bit of refactoring in Line2D and made get_ydata and get_xdata return the actual drawn data (when lines = plt.step(x, y)
plt.fill_between(lines[0].get_xdata(orig=False), 0, lines[0].get_ydata(orig=False))
plt.show() To make things more convenient we added a plt.step(x, y, fill='red')
plt.show() Not sure if either change would be desirable upstream but I'll try to put together a PR. |
@Tillsten: Those lines are not redundant. The first performs the non-affine part of the transform, the second performs the affine part. |
@Tillsten: I'm not sure what the side effects you're suggesting would be -- it probably depends on what ways users are relying on the way it works now -- but maybe as a start we could do that refactor and run it against the test suite... |
An additionnal request is to have an equivalent of 'fill_between' for step. |
Closing as duplicate of #643 |
Add ability to fill between 'step' plots. Closes matplotlib#643 and matplotlib#1709
Add ability to fill between 'step' plots. Closes matplotlib#643 and matplotlib#1709
Add ability to fill between 'step' plots. Closes matplotlib#643 and matplotlib#1709
Add ability to fill between 'step' plots. Closes matplotlib#643 and matplotlib#1709
This was asked a long time ago, and I just ran into a similar need. It would be nice to be able to easily make a filled step plot. The solutions I've come up with are suboptimal.
http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg13072.html
The text was updated successfully, but these errors were encountered: