Oz Nahum wrote:
> Hi all,
> 
> I am trying to plot an oceanographic profile using some ocean data I 
> have. The thing is that in oceanograhy it is common to display graphs 
> where the independent variable (x) is depth, and some other data (i.e 
> salinity or temperature) is plotted against it. The graph is supposed to 
> look like this for example:
>                                             
>                                                          y
>                _______________________________
>               |                                                    *
>               |                                                   *
>               |                                          *  * *
>               |                                        *
>               |                                      *
>               |                                     *
>          x   |                                 *
>               |                               *
>               |                            *
>               |                         *
>               |                        *
>               |                      *
>               |                    *      
>               |                  *
>               |                  *
>               |                  *
> 
> 
> so far I have managed to plot the graph with invert x axis, but I don't 
> know how to change the default graph option of intercept of axes in the 
> bottom left corner.
> So I hope I made my question clear: how can I plot a graph with intecept 
> of axes in the upper left corner ? 

Try this:

import numpy as np
import matplotlib.pyplot as plt
salinity = np.random.random(50)
depth = np.linspace(1, 500)
plt.plot(salinity, depth)
ax = plt.gca()
ax.set_ylim(500, 0)

Things to note:
1) Matplotlib doesn't care about dependent or independent variables. 
With plot(x,y), one variable gets mapped to the x-axis, one gets mapped 
to the y-axis.
2)ax.set_ylim says that the call is (min,max), but what it really means 
is (lower,upper).  This could probably be clearer in the docs.

HTH,

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to