3D surface plot exportable to blender

This topic is originated by a response I posted on twitter (my account @albz_marocchino), at the end of the post the link to tweet.
This disclaimer is because I feel this is just an idea that might encore some potential but it is at present just an idea.

Tayler Morgan-Wall has developed an R raytracing package (rayshader) to plot surfaces in 3D, eventually with animations and materials. The package is particularly useful when dealing with geographical data with above sea level information. It is particularly nice to use, in my case, when dealing with rather complex 2d surfaces where a non experience audience seems to have a better grasp on what it is going on because of the plot animation.

The bottle necks IMHO
The first aspect, rather obvious, is that being a python user I generally play with data in python and then I need to export them to R for plotting. The second reason regards the way you produce the plots in 3D. I found myself to require constantly more 3D plots, either be 2D surfaces plotted in 3D or eventually pure 3D. I am also facing the necessity to have all these 3D plots, aggregated in a larger 3D plot that somehow I can navigate. I came across in the past in Blender, I remember being fairly easy to gather together 3D images and play with them for a good graphical aspect.

The suggestion IMHO
I posted the idea on twitter, something like being able to export graph to a 3D editor such as blender. I want to keep on the due control on the math side when dealing with data, quick plots to check all variables are in the right place, but when I am done with the technical part Iā€™d like to have (possible) a more suitable tool for graphic rendering. Something that allowed me to place lights, change opacities and materials at a click of a mouse. I am wondering if this such option is already available, if there is any package that allow for that if not if it this idea sounds al least meaningful.

This is the tweet link

Can you post on https://t.co/oNTL7uSNiz with more details?

ā€” Matplotlib (@matplotlib) May 3, 2020

As to the original idea of the ray tracing package, @nicolas.rougier has written a package to do nearly-fully 3D plots in Python with Matplotlib.

But getting back to Blender, it does contain a Python interpreter, so you should be able to do something in its console to generate meshes from your data. See for example: