View Single Post
  #1  
Old 07-21-2011, 11:12 AM
hotshotiguana hotshotiguana is offline
Member
 
Join Date: Mar 2011
Posts: 22
Matplotlib Figure Upside Down

Hi,

I am trying to put a figure.canvas image on a texture that I have created in Vizard, but every time I try to setImageData() on that texture the image is displayed upside-down. Is there a way to flip this image before placing it on the texture? See my code below.
fig = plt.figure(num=3, figsize=(10.24, 5.12), dpi=100, edgecolor='k', facecolor='w')
ax = fig.add_subplot(111)
ax.plot(x,y)
fig.canvas.draw()
imageData = fig.canvas.tostring_rgb()
imageSize = fig.get_width_height()
myTex.setImageData(imageData, imageSize) #myTex is a blank white wall

Thanks,
Chris
Reply With Quote