On Friday, October 14, 2011, jopeto <g_nikifo...@hotmail.com> wrote:
>
> Hello,
>
> I have a question regarding setting a custom axis range. Here's a basic
> example:
>
> import matplotlib.pyplot as plt
>
> fig = plt.figure()
> ax = fig.add_subplot(1,1,1)
> ax.plot([1,2,3])
> ax.axis([xmin,xmax,ymin,ymax])
> plt.show()
>
> Now the question that I'm having is the following. The way I understand it
> now, I either have to live with the default axis ranges which matplotlib
> gives me, or I need to change all four values xmin, xmax, ymin, ymax using
> the ax.axis command. Say that I'm happy with xmin, ymin and ymax, and I
only
> want to set xmax to a value slightly larger than the default. Is there a
way
> to specify just that and to be able to keep the other three? The command
> which I'm looking for would be something like:
>
> ax.axis([keep default, xmax, keep default, keep default])
>
> If someone has a suggestion, I would be very grateful.

Use ax.set_xlim() and it's y-axis equivalent. You can even use kwargs to
those functions to manually set only one of the two limits.

Ben Root
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to