Diplaying 2D images in mplot3d

Dear list,

I would like to display a 2D image in a mplot3d axe in order to combine it with a surface3D or a bar3d plot for instance. The effect I am looking for is similar to what can be seen in the bottom XY plane of http://matplotlib.org/1.4.0/examples/mplot3d/contourf3d_demo2.html, except that I would like to have a custom image instead of the filled contours.

I googled the subject and found only messages dating at best from 2010. These messages mentioned that the imshow() method did not work on a mplot3d. Indeed it does not.
The only alternatives offered by the googled answer to my problem were to switch to VTK or Mayavi. For one thing, I never managed to install VTK on my PC, and I already have other matplotlib figures in my wxpython application so I would really like to stick to matplotlib.

Does anyone have pointers as to how I could display a 2D image in mplot3d? Do I need to create a new artist in order to replace the non-functionning imshow?
I see that patch collections work fine in mplot3D. Would it be feasible to load an image and have it displayed as a patch collection (1 patch for each pixel)?

Any advice would be highly appreciated,

Fabrice

···

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

I tried something like this awhile back to no avail. Because of the kludgy nature of mplot3d, we are lucky we even can display 2d artists like polygons (and, this is me speaking as the de facto maintainer of mplot3d!). Images are an entirely different beast, unfortunately.

What might work is getting a pcolormesh object converted into 3d. Not pcolor (as that is an image-based object), but the QuadMesh object that gets returned by pcolormesh(). I haven’t tried to convert that into a 3d equivalent, but it might be feasible.

I would also check out glumpy: https://code.google.com/p/glumpy/. I could have sworn I have seen examples of glumpy treating images as “texture” data for surfaces.

I hope this points you in a useful direction!

Ben Root

···

On Tue, Sep 30, 2014 at 5:54 PM, Fabrice C. <kappamonagare@…527…> wrote:

Dear list,

I would like to display a 2D image in a mplot3d axe in order to combine

it with a surface3D or a bar3d plot for instance. The effect I am

looking for is similar to what can be seen in the bottom XY plane of

http://matplotlib.org/1.4.0/examples/mplot3d/contourf3d_demo2.html,

except that I would like to have a custom image instead of the filled

contours.

I googled the subject and found only messages dating at best from 2010.

These messages mentioned that the imshow() method did not work on a

mplot3d. Indeed it does not.

The only alternatives offered by the googled answer to my problem were

to switch to VTK or Mayavi. For one thing, I never managed to install

VTK on my PC, and I already have other matplotlib figures in my wxpython

application so I would really like to stick to matplotlib.

Does anyone have pointers as to how I could display a 2D image in

mplot3d? Do I need to create a new artist in order to replace the

non-functionning imshow?

I see that patch collections work fine in mplot3D. Would it be feasible

to load an image and have it displayed as a patch collection (1 patch

for each pixel)?

Any advice would be highly appreciated,

Fabrice


This email is free from viruses and malware because avast! Antivirus protection is active.

http://www.avast.com


Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer

Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports

Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper

Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer

http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users