ggplot(mapping=None, data=None, environment=None)¶
Create a new ggplot object
Default aesthetics for the plot. These will be used by all layers unless specifically overridden.
Default data for for plot. Every layer that does not have data of its own will use this one.
If a variable defined in the aesthetic mapping is not found in the data, ggplot will look for it in this namespace. It defaults to using the environment/namespace. in which ggplot() is called.
Render the complete plot
True, return ggplot object.
This method does not modify the original ggplot object. You can
get the modified ggplot object with
save(filename=None, format=None, path=None, width=None, height=None, units='in', dpi=None, limitsize=True, verbose=True, **kwargs)¶
Save a ggplot object as an image file
File name to write the plot to. If not specified, a name like “plotnine-save-<hash>.<format>” is used.
Image format to use, automatically extract from file name extension.
Path to save plot to (if you just want to set path and not filename).
Width (defaults to value set by the theme). If specified the height must also be given.
Height (defaults to value set by the theme). If specified the width must also be given.
Units for width and height when either one is explicitly specified (in, cm, or mm).
DPI to use for raster graphics. If None, defaults to using the dpi of theme, if none is set then a dpi of 100.
True (the default), ggsave will not save images
larger than 50x50 inches, to prevent the common error
of specifying dimensions in pixels.
True, print the saving information.
Additional arguments to pass to matplotlib savefig().