Description
I am interested in adding the ability to plot surface plots of 2D xarray data using matplotlib's 3D plotting function plot_surface()
.
This would be nice because a surface in 3D is much more useful for showing certain features of 2D data then color plots are. For example an outlier would appear as an obvious spike rather than just a single bright point as it would when using plot.imshow()
. I'm not suggesting adding full 3D plotting capability, just the ability to visualise 2D data as a surface in 3D.
The code would end up allowing you to just call xr.Dataarray.plot.surface()
to create something like this example from here (code here):
Obviously xarray would be used to automatically set the axes labels and title and so on.
As far as I can tell it wouldn't be too difficult to do, it would just be implemented as another 2D plotting method the same way as the Dataarray.plot.imshow()
, Dataarray.plot.contour()
etc methods currently are. It would require the imports
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
but these would only need to be imported if this type of plot was chosen.
I would be interested in trying to add this myself, but I've never contributed to an open-source project before. Is this a reasonable thing for me to try? Can anyone see any immediate difficulties with this? Would I just need to have a go and then submit a pull request?