----- Forwarded message from Damon McDougall <dam...@gm...> -----
> Date: Fri, 10 Aug 2012 12:47:22 +0100
> From: Damon McDougall <dam...@gm...>
> To: satish maurya <mau...@gm...>
> Cc: mat...@li...
> Subject: Re: [Matplotlib-users] help me Velocity depth plot in matplotlib
>
> On Fri, Aug 10, 2012 at 02:09:39PM +0530, satish maurya wrote:
> > Dear All,
> >
> > I want to stairs plot (similar in matlab) matplotlib
> > First i want for i data-set then multiple data-set super impose on that.
> > I attach the figure it's showing velocity-depth stairs plots for
> > superimpose (like hold on in matlab)
> > large data-set.
> > can anybody tell me how to plot that.
> >
>
> I'm not sure I understand what you're asking. Are you asking how to make
> a stairplot, or are you asking how to make *multiple* plots on one set
> of axes?
>
> If your question is the former, matplotlib does not currently have a
> stairplot implementation, but it wouldn't be hard to use the usual
> plot() function to achieve the desired effect:
>
> Before:
>
> x = arange(0, 10, 1)
> y = x * (10.0 - x)
> plot(x, y)
>
> After:
>
> x = arange(0, 10, 1)
> x_m = x - 0.5 # left-hand midpoints
> x_p = x + 0.5 # right-hand midpoints
> y = x * (10.0 - x)
> x_all = dstack((x_m, x, x_p)).flatten()
> y_all = dstack((y, y, y)).flatten()
> plot(x_all, y_all)
>
> If your question is the latter, you can toggle the hold state just by
> calling
>
> hold()
>
> Hope this helps.
>
> >
> > see the figure
> >
> > Thank you
> >
> > --
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > *Satish Maurya*
> > *Research Scholar*
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> --
> Damon McDougall
> http://damon-is-a-geek.com
> B2.39
> Mathematics Institute
> University of Warwick
> Coventry
> West Midlands
> CV4 7AL
> United Kingdom
----- End forwarded message -----
I have put in a PR regarding this, since this feature exists in Matlab.
This brings the plotting interface of matplotlib more in line with that
of Matlab. You can view the request at:
https://github.com/matplotlib/matplotlib/pull/1068
Feedback welcome.
Best,
Damon
--
Damon McDougall
http://damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom
|