lava / matplotlib-cpp

Extremely simple yet powerful header-only C++ plotting library built on the popular matplotlib
MIT License
4.42k stars 1.14k forks source link

A question/request for imshow(), in lieu of an issue. #9

Open Sporean opened 8 years ago

Sporean commented 8 years ago

I don't see any option of how to contact directly, so I hope you don't mind me using this instead.

I love what you're doing with matplotlib here, thank you for developing this as an easy way to plot; all other ways to plot in C++ are horrendous. I was curious if it has the capability of plotting matrices yet, and if not, will it be implemented in the future? I would modify the file myself, but I'm not versed enough in code to do that yet. I'm specifically looking to use matplotlib's function's: figure() & imshow(), in order to plot a matrix as an image (see any picture of Ising Model as an example of what I wish to accomplish). [I also hope to use it as a means to do contour maps in the future, and it would be beneficial also to have matplotlib's 2d quiver() option.]

Thank you for your time.

lava commented 8 years ago

Just exposing the functions would be easy, the question is what kind of data they expect. The doc for imshow() just says array_like (http://matplotlib.org/api/axes_api.html#matplotlib.axes.Axes.imshow), but I'm not sure what that means. I imagine going through a huge matrix and converting each element into PyNumber individually could become very slow.