Try this:
from pylab import *
from numpy import *
Z = random.randn(100,100)
figure()
subplot(1,2,1)
imgHandle = imshow(Z, cmap=cm.gray)
scatter(random.rand(10)*100,random.rand(10)*100)
colorbar(imgHandle)
title('Hello')
show()
By the way, I find jet a bad colormap to represent scientific data:
Dear all,
Consider the following short program:
from matplotlib.pyplot import title, show
for i in xrange(3):
title(i+1)
print window No. +str(i+1)+ was closed
show()
If I run it under Windows XP, at each show() the program displays a window and
blocks; if I close the window by
Hello -
I am using matplotlib in eclipse. For 3D plot test, I am using:
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = Axes3D(fig)
X = np.arange(-5, 5, 0.25)
Y = np.arange(-5, 5,
Hi,
I am trying to use griddata to plot some (irregularly) spaced data as a
contour plot, but sometimes ALL the grid it outputs is masked: so no plot.
In the docs I read:
A masked array is returned if any grid points are outside convex hull
defined by input data (no extrapolation is done).
but
I think it should be possible to do unsorted scatter plot, so you can
avoid the second loop. Maybe the current source doesn't allow for,
but it's certainly possible (hu, I'm not that aquainted with current
z-sorting code, so maybe I'm wrong?) It may be that current z-sorting
uses the mesh grid.
Oh, sorry, it was late at night, and so on, but in fact you said it's
a standard example, so well ... I was wrong.
Friedrich
2010/4/1 Friedrich Romstedt friedrichromst...@gmail.com:
You forgot about the attachment?
Friedrich
Year, I think we could do unsorted scatter plot as well, however I'm
still not satisfied with the book tracking routines I have to check
when doing the surface plotting.
Anyway, thanks, man. You saved a lot.
Hope this time, it CC to the mailing list as well. :-)
OK, I found the answer myself. It appears that multiple calls to show() are at
the moment officially unsupported, although they do work for some backends on
some platforms (see e.g.
http://matplotlib.sourceforge.net/faq/howto_faq.html#use-show ). In particular,
I have found that:
- With Qt4Agg
On 4/3/2010 11:19 PM, Enzo Michelangeli wrote:
multiple show() functionality is important for many users (see
e.g.
http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg13099.html
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.ion
hth,
Alan Isaac