Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add stairstep plotting functionality #1068

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

Closed
wants to merge 2 commits into from

Conversation

dmcdougall
Copy link
Member

This feature replicates Matlab's `stairs' function to produce stairstep
type plots. These plots are useful for plots in signal processing for
looking at discretely sampled data. Valid function calls are

ax.stairs(y) # Make a stairstep plot of the values in y
ax.stairs(x, y) # Stairstep plot of the values in y at points in x

See here for the Matlab interface.

Example output:

example output

This feature replicates Matlab's `stairs' function to produce stairstep
type plots. These plots are useful for plots in signal processing for
looking at discretely sampled data. Valid function calls are

stairs(y) # Make a stairstep plot of the values in y
stairs(x, y) # Stairstep plot of the values in y at points in x
@efiring
Copy link
Member

efiring commented Aug 10, 2012

How does this differ from step?
http://matplotlib.sourceforge.net/examples/pylab_examples/step_demo.html

@dmcdougall
Copy link
Member Author

I did not know this existed!

Damon McDougall
[email protected]
http://damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom

On Friday, 10 August 2012 at 19:20, Eric Firing wrote:

How does this differ from step?
http://matplotlib.sourceforge.net/examples/pylab_examples/step_demo.html


Reply to this email directly or view it on GitHub (#1068 (comment)).


__all__ = ['stairs']

def stairs(axes, *args, **kwargs):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent with the rest of the code-base, I would change "axes" to "ax"

@dmcdougall
Copy link
Member Author

This should probably be closed since it already exists, as @efiring pointed out. Unless anybody disagrees? It seems moot to duplicate existing functionality.

@mdboom
Copy link
Member

mdboom commented Aug 10, 2012

Well, perhaps the meta question is: what made it difficult for @dmcdougall to find the existing functionality, and how could that be improved? Maybe we need a patch for that...

@efiring
Copy link
Member

efiring commented Aug 10, 2012

We do, and Ben started on at least part of the solution, which is putting some organization and editing into the gallery. There is only one step example, and it is burried in the middle; I had to scan the gallery twice to find it, and if I hadn't been pretty sure it was there, I would likely have missed it.

@dmcdougall
Copy link
Member Author

I went to the matplotlib homepage, and did a command-f for stairs (because someone on the mailing list was asking how to make stairstep plots).

Also, step is not on the list on the homepage either.

Perhaps re-naming step to stairs (or wrapping it, so people's scripts don't break) so the Matlab and matplotlib naming conventions are more aligned would be useful to avoid future confusion. Or, adding step to the homepage so it can be found more easily.

@mdboom
Copy link
Member

mdboom commented Aug 10, 2012

Yeah -- that list on the homepage was manually generated many versions ago, so it's incomplete. As part of my reorganization of the front page in #1067 I'm proposing to just get rid of it and funnel people to the pyplot documentation instead. Not sure that's the best solution either, as some people surely find that list useful.

@dmcdougall
Copy link
Member Author

I use it every day. I command-f the function I want so I can look at the docs. I always have to check it to remind myself, for example, which element of the extent kwarg list in imshow refers to which bound.

@pelson
Copy link
Member

pelson commented Aug 11, 2012

@mdboom: Maybe a similar table to the one that currently exists could be autogenerated and the content come from the autosummary extension.

@efiring
Copy link
Member

efiring commented Aug 13, 2012

There is useful discussion here, but as a pull request, this really needs to be closed.

@efiring efiring closed this Aug 13, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants