[Matplotlib-users] How to center axes intersecting at (0,0)

Michael Droettboom mdroettboom at continuum.io
Tue Dec 1 08:21:45 EST 2015


This is actually the subject of Nicolas Rougier's great tutorial here:
http://www.labri.fr/perso/nrougier/teaching/matplotlib/

Mike

On Fri, Nov 13, 2015 at 9:01 AM, sh77 via Matplotlib-users <
matplotlib-users at python.org> wrote:

> Hi,
>
> I'm new to matplotlib. I would like to do something very simple. In the
> figure created by the following code, I would like the axes to be centered
> in the figure and intersecting at point (0,0):
>
> import matplotlib.pyplot as plt
> plt.plot([1,2,3,4], [1,-4,9,-16], 'ro')
> plt.axis([-6, 6, -20, 20])
> plt.title('Title')
> plt.show()
>
> Can you please give me the simplest lines of code to achieve this? (the
> hints to solutions that I have seen over the internet are amazingly complex
> for such a simple task)
>
> Many thanks
>
> saikari
>
>
>
> --
> View this message in context:
> http://matplotlib.1069221.n5.nabble.com/How-to-center-axes-intersecting-at-0-0-tp46427.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-users
>



-- 
Michael Droettboom
Continuum Analytics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20151201/97e34252/attachment.html>


More information about the Matplotlib-users mailing list