SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Bryan F. <bry...@gm...> - 2007年12月23日 20:07:17
I have a pcolormest and a fill that are plotted on the same graph (they hav=
e
the same scale). Is there an easy way
to only plot the values of pcolormesh that lie in the fill?
pcolormesh(oX, oY, test, shading=3D'flat', cmap=3Dcm.gray_r)
fill([-x1,x2,x2,-x1], [-y1,-y1,y2,y2], 'b', alpha=3D0.2, edgecolor=3D'r')
--=20
"The game of science can accurately be described as a never-ending insult t=
o
human intelligence." - Jo=E3o Magueijo
From: Eric F. <ef...@ha...> - 2007年12月24日 00:30:43
Bryan Fodness wrote:
> 
> I have a pcolormest and a fill that are plotted on the same graph (they 
> have the same scale). Is there an easy way
> to only plot the values of pcolormesh that lie in the fill?
> 
> pcolormesh(oX, oY, test, shading='flat', cmap=cm.gray_r)
> fill([-x1,x2,x2,-x1], [-y1,-y1,y2,y2], 'b', alpha=0.2, edgecolor='r')
Do you mean something like this?
ii = (oX > -x1) & (oX < x2)
jj = (oY > -y1) & (oY > y2)
pcolormesh(oX[ii], oY[jj], test[jj,][:,ii])
This assumes your oX and oY are 1-D, so you are plotting rectangular 
mesh. Correct?
Eric
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /