New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enabling 3D plots? #582
Comments
Linking back to a StackOverflow question about 3D surface plot with my answer implementing |
While 3D plotting is outside the scope of the project, making it possible to build off of / extend plotnine is a very desired goal. |
All right, so It includes four geoms as a proof-of-concept (line, scatter, voxels, surface), but matplotlib allows for much more. In particular I think that having barplors and erorrbars would be rather useful and relatively easy to get in, but both would take time I don't have, and former would be much easier after restructuring internals of |
I do not care for the name, for now it makes sense. All the functionality is 3d however now that you have started thinking about extending plotnine, you may have interesting unique ideas that are not 3d and they would need a home. |
Could 3D plots be supported by plotnine, or if not, could the internals be slightly adjusted to enable easy extension to 3D plots? Currently with a simple hack it is possible to get a simple 3d plotnine plot:
The hack is:
However, because it is bypassing
self.facet.make_axes()
call in_create_figure()
it does not support faceting.While I would prefer plotnine to just support 3D plots, I fully respect if this is not aligned with the vision of the project; in that case the following places could be reworked to simplify extending:
geom_point
easier, thegeom_point.draw_groups()
method could be a classmethod rather than a static method, and instead of using hard-codedgeom_point
it would usecls
; presumably this would be also need for other geoms which can have 3d equivalents (line, area, etc).xlabel
andylabel
a new common methodLayout.label(self, labels, axis)
could replaceLayout.xlabel(self, labels)
andLayout.ylabel(self, labels)
OR the hard-coded use ofself.layout = Layout()
inggplot._build
could be replaced with either a new methodggplot._init_layout()
or a new class attributelayout_class = Layout
could be added (and then the call would be replaced withself.layout = self.layout_class()
);fig.add_subplot(gs[i - 1])
call in_create_subplots
should allow to passprojection='3d'
keyword argument; this could be conditional on layout having a projection attribute.Of course there some more changes for full integration (e.g.
flip
ing of coordinates would need to know around which axis), but I believe that very little changes would be needed to gain quite a lot in terms of usability.The text was updated successfully, but these errors were encountered: