v0.13.0
API Changes
-
Requires python >= 3.9
-
Using the
print
orrepr
functions to draw and show the plot has been deprecated. Use ggplot.show(). -
The name of the calculated aesthetic of
stat_function
changed fromy
tofx
. -
stat_ecdf
has gained thepad
parameter. The default is set toTrue
, which pads the domain with-inf
andinf
so that the ECDF does not have discontinuities at the extremes. To get the behaviour, setpad
toFalse
. (#725) -
Removed the environment parameter from
ggplot
. -
When a ggplot object is the last in a jupyter cell, the output image will not be followed by string meta information about the figure/image.
This will happen even if the backend is set to an interactive one.
If you set the backend to an interactive one, use
show
to draw the plot. -
The default horizontal alignment for the plot title is center if it there is no subtitle. When there is a subtitle, the default is to have both aligned to the left.
-
Some parameters that control the look and feel of
guide_colorbar
andguide_legend
have been removed. For their place, thetheme
parameter has been introduced and it gives better control of the look and feel. -
Themeables
legend_entry_spacing
,legend_entry_spacing_x
andlegend_entry_spacing_y
have been renamed tolegend_key_spacing
,legend_key_spacing_x
andlegend_key_spacing_y
respectively -
facet_grid
now accepts two parameters,rows
andcols
, to specify the variables along the two dimensions of the panels.The previous way of using a single parameter will still work if it is a string. For cases where the value was a list, e.g.
facet_grid(facets=["col1", "col2"])
can be rewritten as any one of;
facet_grid("col1", "col2") facet_grid(["col1"], ["col2"]) facet_grid(rows="col1", cols="col2") facet_grid(rows=["col1"], cols=["col2"])
-
The
facets
parameter infacet_wrap
has also changed to a more straight forward specification for the column variables. It expects a single string or a list/tuple of strings. (#545)However, the R-style formula strings are still silently accepted.
New
-
Added symmetric logarithm transformation scales
scale_x_symlog
andscale_y_symlog
-
Gained themeables
to set the plot margin on each side independently.
-
Gained themeables
axis_ticks_length_major_x
axis_ticks_length_major_y
axis_ticks_length_minor_x
axis_ticks_length_minor_y
to control the x & y axis ticks length.
-
Gained themeables
to control the x & y tick padding.
-
Some parameters in
element_text
can now accept lists/tuples to set the values on individual text objects. (#724) -
Gained the option
figure_format
to set the format of the inline figures in an interactive session.
e.g.from plotnine.options import set_option set_option("figure_format", "svg")
will output all subsequent figures in svg format.
-
Improved support for customizing guides/legends.
-
You can now add a frame to the colobar
-
You can now apply themes to individual guides, e.g.
+ guides(color=guide_colorbar(theme=theme_xkcd()))
or
+ guides(color=guide_legend(theme=theme_minimal())
-
You can now place legends at more than one position around the panels. e.g.
+ guides( color=guide_colorbar(position="left"), fill=guide_legend(position="bottom"), size=guide_legend(position="bottom") )
Puts the
fill
andsize
guides at the bottom, and thecolor
guide on the left. -
You can easily justify the legend along the four edges of the space around the panel area.
-
You can now place the legend inside the panels with easily control its location.
-
-
The
space
parameter offacet_grid
now responds to the valuesfree
,free_x
andfree_y
to have panels whose relative width and/or height depends on the data range. (#545)
Bug Fixes
-
Fixed handling of minor breaks in
scale_continuous
to accept numpy arrays and when the scale has a transform, that the minor breaks are supplied in user space and not transform space. Just like the major breaks. (#685) -
Fixed theming of axis_ticks with the size parameter. (#703)
-
Fixed space handling around
axis_label
,axis_text
andaxis_ticks
when the ticks are turned off. -
Fixed bug in
geom_path
where the lineend parameter was ignored. (#727) -
Fixed bug where
theme(legend_background=element_blank())
messed up the position of the legend, instead of only removing the background. -
Fixed using
facet_grid
with a column namedkey
. (#734) -
Fixed using legend when using an identity scale and reordering the breaks. (#735)
-
Fixed drawing the upper outline of
geom_ribbon
. (#728) -
Fixed issue where the gridlines overlap the panel border. (#638)