How you map to calculated aesthetics has changed. Use the
after_stat() function. The old methods
'..name..' have been deprecated.
You can now map to aesthetics at three different stages. See
geom_violin gained the a new parameter
with which you can draw half violin (density curve on one side and flat
on the other).
geoms gained new parameter
raster for the
Layer. You can use it to rasterize any layer
when the resulting plot is of vector format e.g.
Fixed issue where some plots with a colorbar would fail for specific themes. (GH424)
geom_map to plot
MultiLineString geom types.
geom_text to allow any order of
data positional arguments.
Fixed bug were the plotted image may have ignored theming that relied on some Matplotlib rcParams. (GH451)
Manual scales now match the values of the breaks if the breaks are given. (GH445)
<ggplot: ...>) anymore. There is now a difference between
Added option to for the
base_family of a theme, now you can set it
once with and have it be applied to all themes. (GH436)
from plotnine.options import set_option set_option('base_family', 'Comic Sans MS')
You can now add
None to a ggplot, doing so returns a copy of the
the ggplot object. (GH474)
Better handling of multiline facet labels. (GH484)
Fixed issue where a plot has no data and the geoms have no data, but the mappings are valid. (GH404)
Fix regression in
v0.7.0 where plots with a colorbar
would fail if using
Changed the default method of caculating bandwidth for all stats that
use kernel density estimation. The affected stats are
stat_sina. These stats can now work with groups
that have a single unique value.
plotnine.scale.scale_colour_continuous to refer to the same
plotnine.scale.scale_color_cmap so the parameter
cmap_name refers to the name of the color palette and name refers
to the name of the scale. (GH371)
aes got an internal function
makes it easy to change the ordering of a discrete variable according
to some other variable/column.
stat_smooth can now use formulae for linear
Fixed issue where a wrong warning could be issued about changing the transform of a specialised scale. It mostly affected the timedelta scale.
plotnine.geoms.geom_violin and other geoms when used
position='dodge' not to crash when if a layer has an empty
group of data.
Fixed all stats that compute kernel density estimates to work when all the data points are the same. (GH317)
Fixed issue where setting the group to a string value i.e.
aes() failed due to an error.
Fixed issue where discrete position scales could not deal with fewer limits than those present in the data. (GH342)
plotnine.position.jitter_dodge to work when
used as an aesthetic. (GH372)
draw parameter of
plotnine.geoms.geom_map has been removed.
Shapefiles should contain only one type of geometry and that is the geometry
that is drawn.
Ordinal (Ordered categorical) columns are now mapped to ordinal scales. This creates different plots.
The default mapping for the computed aesthetic size of
stat_sum has changed to
'stat(n)'. This also
changes the default plot for
geom_text gained the
and can now repel text.
Added scales for ordinal (ordered categorical) columns.
geom_step gained the option
mid for the
direction parameter. The steps are taken mid-way between adjacent x values.
Fixed bug where facetting would fail if done on a plot with annotation(s) and one of the facetting columns was also a variable in the environment.
Fixed bug that made it impossible to map to columns with the same name as a calculated columns of the stat. (GH234)
Fixed bug in
position_dodge where by bar plot
could get thinner when facetting and useing
preserve = 'single'.
Fixed bug in
coord_trans where if the transformation
reversed the original limits, the order in which the data was laid out remained
Fixed bug where one could not use the British spelling
colour to rename
a color scale. (GH264)
Fixed bug where using free scales with facetting and flipping the coordinate axes could give unexpected results. (GH286)
Fixed unwanted tick along the axis for versions of Matplotlib >= 3.1.0.
Fixed bug where layers with only infinite values would lead to an exception if they were the first layer encountered when choosing a scale.
Legends are now plotted in a predictable order which dedends on how the plot is constructed.
The spokes drawn by
geom_spoke can now have a fixed
Aesthetics that share a scale (e.g. color and fill can have the same scale) get different guides if mapped to different columns.
method_args parameter in
stat_smooth can now
differentiate between arguments for initialising and those for fitting the
position_nudge can now deal with more geoms e.g.
width of the boxplot can now be set irrespective of the stat.
The mid-point color of
matches that of the trainned data.
The way in which layers are created has been refactored to give packages that that extend plotnine more flexibility in manipulating the layers.
You can now specify one sided limits for coordinates. e.g. coord_cartesian(limits=(None, 10)).
All the themeables have been lifted into the definition of
theme so they can be suggested autocomplete.
Fixed issue where with the subplots_adjust themeable could not be used to set the wspace and hspace Matplotlib subplot parameters. (GH185)
stat_bin where setting custom limits for the
scale leads to an error. (GH189)
Fixed issue interactive plots where the x & y coordinates of the mouse do not show. (GH187)
Fixed issue where
minor_breaks for tranformed scaled would have to be given
in the transformed coordinates. Know they are given the data coordinates just
like the major
For all geoms, with
np.inf are interpreted as the boundary of the plot panel.
Discrete scales now show missing data (
nan). This behaviour
is controlled by the new
minor_breaks parameter for continuous scales can now be given as an
integer. An integer is taken to controll the number of minor breaks between
any set of major breaks.
Calculated aesthetics are accessed using the
function. The old method (double dots
..name..) still works.
stat_qq calculates slightly different points
for the theoretical quantiles.
Fixed issue where colorbars may chop off the colors at the limits of a scale.
Fixed issue with creating fixed mappings to datetime and timedelta type values.(GH88)
Fixed issue with x and y scales where the
name of the scale was
ignored when determining the axis titles. Now, the
is specified, it is used as the title. (GH105)
Fixed bug in discrete scales where a column could not be mapped to integer values. (GH108)
Make it possible to hide the legend with
scale='free_y', the panels share axes
along the row or column.
Fixed continuous scales to accept
Fixed bug for discrete position scales, where
drop=False did not drop
unused categories (GH139)
Fixed bug where the legend text of colorbars could not be themed. (GH171)
plotnine.ggplot.save() gained an extra parameter
It no longer guesses when to print information and when not to.
plotnine.ggplot.draw() gained an extra parameter
minor_breaks parameter of scales is a callable, it now
expects one argument, the
limits. Previously it accepted
Changed parameter settings for
span=0.75 instead of
When using loess smoothing, the control parameter
is only set to the value
'direct' if predictions will
be made outside the data range.
Better control of scale limits. You can now specify individual limits of a scale.
scale_y_continuous(limits=(0, None)) xlim(None, 100)
You can also use
Low and high
scale limits can now be expanded
separately with different factors multiplicative and additive factors.
The layer parameter show_legend can now accept a
dict for finer
grained control of which aesthetics to exclude in the legend.
Infinite values are removed before statistical computations
stats also gained new parameter
na_rm, that controls whether
missing values are removed before statistical computations.
qplot() can now use the name and a Pandas series to
label the scales of the aesthetics.
You can now put stuff to add to a ggplot object into a list and add that that instead. No need to wrap the list around the internal class Layers.
lst = [geom_point(), geom_line()] g = ggplot(df, aes('x', 'y')) print(g + lst)
Using a list allows you to bundle up objects. I can be convenient when creating some complicated plots. See the Periodic Table Example.
You can now use a
dict (with manual scales) to map data values to
Fixed bug where facetting led to a reordering of the data. This
would manifest as a bug for
geoms where order was important.
Fix bug where facetting by a column whose name (eg.
a python keyword resulted in an exception. (GH28)
Fix bug where y-axis scaling was calculated from the
Fix bug where initialising geoms from stats, and positions from geoms,
when passed as classes (e.g.
Fixed bug in
was being ignored.
Fixed bug where boolean data was mapped to the same value on the coordinate axis. (GH57)
Fixed bug in
stat_boxplot where setting the
width parameter caused an exception.
Fixed bug where manually setting the aesthetic
fill='None' could lead to a black fill instead of an empty
Fixed bug where computed aesthetics could not be used in larger statements. (GH7)
Fixed bug in
stat_summary where the you got
an exception for some types of the x aesthetic values.
Fixed bug where
ggplot(data=df) resulted in an exception.
Fixed missing axis ticks and labels for
when the scales are allowed to vary (e.g scales='free') between
Fixed issues where lines/paths with segments that all belonged in the same group had joins that in some cases were "butted".
geom_text now uses
parameter names for the horizontal and vertical alignment. This
is what matplotlib users expect. The previous names
vjust are silently accepted.
Layers() can now be used to bundle up
stats. This makes it easy to reuse
geoms and stats or
organise them in sensible bundles when making complex plots.
First public release