Question

I would like to blit a 2d image (like a png) to a location in 3-space on a 3D matplotlib figure. Essentially, I want the image to always be facing the user regardless of how the plot is rotated. It would be best if the blitted image did not scale as the user zoomed in and out as well.

One would think that this would be easy to do by accessing the low level rastering functions in matplotlib, but I can't find any documentation that describes what I would like to do.

Was it helpful?

Solution

If you put in an image as an annotation, zooming in on the axes will not scale the image. For example, see this demo. (To run the demo script, replace grace_hopper.png with lena.png.)

For example, just for an easy reference on zooming I've added a line of blue squares to the plot. The top image below show the unzoomed, and I've zoomed in in the lower one.

enter image description here enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top