I would like to create scientific plots using matplotlib and then dynamically load the plots as a texture to be displayed on 3D geometry in Panda3D. I want to do this in memory, rather than saving the plot image to the hard drive and then loading the the texture from the file.
I imagine there is a way to do this but I’m not sure what approach to take. Matplotlib allows figures to be saved to a file-like object, I can use PIL to open the file-like object and access the pixel data. From there, I don’t know how to procedurally set or write the texture image data in Panda3d. Or is there another, better approach than this?
Any help much appreciated.