here's an example

a call to pyplot.axis() after I call pcolor straightens it out though. thx
gokhan, and sorry to all for not picking that up in the docs myself.

and finally, `demolishor' is a great and hilarious song by a band called the
acacia strain, in case there are parties interested in music that might make
your officemates think you're satanic. i am delighted this thread generated
such an enthusiastic response in this regard.

ta ta

On Fri, Aug 28, 2009 at 3:32 PM, John Hunter <jdh2...@gmail.com> wrote:

> On Fri, Aug 28, 2009 at 1:59 PM, DEMOLISHOR! the
> Demolishor<destrooo...@gmail.com> wrote:
> > This is the result from a call to pyplot.pcolor() -- why do the axes
> > automatically expand beyond the range of the data? And how can I set them
> > back? I am not seeing an obvious keyword argument in the pcolor docs to
> do
> > this...
> >
>
> could you post a complete example that replicates the problem?
>
> JDH
>

Here you go.
#!/usr/bin/env python

import numpy

from matplotlib import pyplot


bi_mean = [1,2]
cov_mat = [[1, 2],
           [2, 1]]

xy_data = numpy.random.multivariate_normal(bi_mean, cov_mat, 100000)

x_data = [pt[0] for pt in xy_data]
y_data = [pt[1] for pt in xy_data]

zfill, xbins, ybins = numpy.histogram2d(x_data, y_data, bins=[100,100],
                                        range=((-3.2,7.2),(-3.2,7.2)))
xpts = numpy.linspace(-3.2, 7.2, 100)
ypts = numpy.linspace(-3.2, 7.2, 100)

pyplot.pcolor(ypts, xpts, zfill)
pyplot.colorbar()
pyplot.savefig('pyplot1.png')



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to