# [SciPy-user] Plotting with PyLab

Dominique Orban dominique.orban@gmail....
Wed Oct 24 16:45:47 CDT 2007

```On 10/24/07, Nuttall, Brandon C <bnuttall@uky.edu> wrote:

> I'd like to make a plot (graph) where the x and y units have the same
> scale. That is, one unit in the x direction is the same physical size as 1
> unit in the y direction; circles will be circles and squares squares. What
> I'm doing is I'm given a path through 3d space. At a given distance, MD,
> along that path I am supplied an azimuth (the departure from vertical) and a
> bearing. I can translate these data to (x,y,z).
>
> What I want to do is make three maps showing the trajectory of the path:
> XY space, XZ space, and YZ space. At this time, a 3D visualization is not
> needed and, in actuality, only the XY plot is required.
>
> If pylab is not right, suggestions on what module I should use is
> appreciated.
>

Hi Brandon,

If I understand well, what you're looking for is something like this:

import pylab
fig = pylab.figure()    # Create a figure
ax = fig.gca()             # Obtain axes in the current figure
ax.plot( [0,1], [0,0], 'k-' )   # Plot the [0,1] x [0,1] square
ax.plot( [0,0], [0,1], 'k-' )
ax.plot( [0,1], [1,1], 'k-' )
ax.plot( [1,1], [0,1], 'k-' )
ax.set_xlim( [-0.3,1.3] )   # Adjust x and y range
ax.set_ylim( [-0.3,1.3] )
ax.set_aspect('equal')   # Make aspect ratio equal to 1
pylab.show()

and that should produce a square that indeed looks square and not
rectangular.

Dominique
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20071024/04fdf2d2/attachment.html
```