Changelog History

v0.7.1 Changes
August 05, 2020π v0.7.1 is a small bugfix and maintenance release. See the official changelog for details. A copy of the changes is also copied below.
π Bug Fixes
 π Fixed issue where a plot has no data and the geoms have no data, but the mappings are valid. (
404
)  Fixed
preserve='single'
inplotnine.positions.position_dodge
andplotnine.positions.position_dodge2
to work for geoms that only
havex
aesthetic and notxmin
andxmax
e.gplotnine.geoms.geom_text
.  π Fix regression in
v0.7.0
where plots with a colorbar would fail if using~plotnine.themes.theme_matplotlib
.
 π Fixed issue where a plot has no data and the geoms have no data, but the mappings are valid. (

v0.7.0 Changes
June 05, 2020π This is a large release with many bug fixes and enhancements. See offical changelog. A version of the changes is included below.]
API ChangesΒΆ
Changed the default method of caculating bandwidth for all stats that use kernel density estimation. The affected stats are
stat_density
,stat_ydensity
, andstat_sina
. These stats can now work with groups that have a single unique value.Changed
plotnine.scale.scale_colour_continuous
to refer to the same scale asplotnine.scale.scale_color_continuous
.Changed
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)π New FeaturesΒΆ
aes
got an internal functionreorder
which 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 models.π Bug FixesΒΆ
Fixed issue where a wrong warning could be issued about changing the transform of a specialised scale. It mostly affected the timedelta scale.
Fixed
plotnine.geoms.geom_violin
and other geoms when used withposition='dodge'
not to crash when if a layer has an empty group of data.Fixed bug in
plotnine.geoms.geom_path
for some cases when groups had less than 2 points. (GH319)π 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.
group='string'
outsideaes()
failed due to an error.π Fixed issue where discrete position scales could not deal with fewer limits than those present in the data. (GH342)
Fixed issue with using custom tuple linetypes with
plotnine.scales.scale_linetype_manual
. (GH352)Fixed
plotnine.geoms.geom_map
to work with facets. (GH359)π Fixed
plotnine.position.jitter_dodge
to work whencolor
is used as an aesthetic. (GH372)Fixed
plotnine.geoms.geom_qq
to work with facets (GH379)π Fixed skewed head in
plotnine.geoms.arrow
when drawn on facetted plot (GH388)Fixed issue with
plotnine.stats.stat_density
where weights could not be used with a gaussian model. (GH392)Fixed bug where
guide_colorbar
width and height could not be controlled bylegend_key_width
andlegend_key_height
. (GH360)β¨ EnhancementsΒΆ
You can now set the bandwidth parameter
bw
ofstat_ydensity
.Parameters ha and va of
geom_text
have been converted to aesthetics. You can now map to them. (GH325)All themes (except theme_matplotlib) now do not show minor ticks. (GH348)

v0.6.0 Changes
August 21, 2019π This release has many changes, check out the changelog. A version of the changes is included below.
API Changes
π The
draw
parameter ofgeom_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 forgeom_count
.π New Features
geom_text
gained theadjust_text
parameter, and can now repel text. β Added
annotation_logticks
.  β Added
geom_sina
 β Added scales for ordinal (ordered categorical) columns.
geom_step
gained the optionmid
for the direction parameter. The steps are taken midway between adjacent x values. β Added
annotation_stripes
.
π Bug Fixes
π 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 where
coord_flip
would not flip geoms created bygeom_rug
(GH216).π Fixed bug where plots with
theme_xkcd
cannot be saved twice (GH199)π 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
geom_smooth
that made it difficult to use it with stats other thanstat_smooth
. (GH242)π Fixed bug in
position_dodge
where by bar plot could get thinner when facetting and useingpreserve = 'single'
. (GH224)π Fixed bug in
coord_trans
where if the transformation reversed the original limits, the order in which the data was laid out remained unchanged. (GH253)π Fixed bug in
stat_count
wherefloat
weights were rounded and lead to a wrong plot. (GH260)π Fixed bug where one could not use the British spelling
colour
to rename a color scale. (GH264)π Fixed bug in
lims
,xlim
, andylim
wheredatetime
andtimedelta
limits resulted in an error.Fixed bug where
geom_rect
could not be used withcoord_trans
. (GH256)π 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
geom_text
not to error when usinghjust
andvjust
. (GH287)Fixed bug where
geom_abline
geom_hline
andgeom_vline
could give wrong results when used withcoord_trans
.π Fixed bug where layers with only infinite values would lead to an exception if they were the first layer encountered when choosing a scale.
β¨ Enhancements
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 angle.Aesthetics that share a scale (e.g. color and fill can have the same scale) get different guides if mapped to different columns.
When the transform of a specialised (one that is not and identity scale) continuous scale is altered, the user is warned about a possible error in what they expect. (GH254, GH255)
The
method_args
parameter instat_smooth
can now differentiate between arguments for initialising and those for fitting the smoothing model.position_nudge
can now deal with more geoms e.g.geom_boxplot
.The
limits
parameter ofscale_x_discrete
andscale_y_discrete
can now be a function.The
width
of the boxplot can now be set irrespective of the stat.The midpoint color of
scale_color_distiller
now 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. 
v0.5.1 Changes
October 17, 2018π This release only updates the version requirement for the mizani project. See changelog

v0.5.0 Changes
October 16, 2018A copy of the changelog is pasted below.
API Changes
 π Plotnine 0.5.0 only supports Python 3.5 and higher
 π geopandas has been removed as a requirement for installation. Users of
geom_map
will have to install it separately. (178)
π Bug Fixes
 π Fixed issue where with the
subplots_adjust
themeable could not be used to set the wspace and hspace Matplotlib subplot parameters. (185)  π Fixed in
stat_bin
where setting custom limits for the scale leads to an error. (189)  π Fixed issue interactive plots where the x & y coordinates of the mouse do not show. (187)
 π Fixed bug in
geom_abline
where passing the mapping as a keyword parameter lead to a wrong plot. (196)  π 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 majorbreaks
.
β¨ Enhancements
 For all geoms, with
coord_cartesian
float('inf')
ornp.inf
are interpreted as the boundary of the plot panel.  Discrete scales now show missing data (
None
andnan
). This behaviour is controlled by the newna_translate
option.  The
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.

v0.4.0 Changes
August 01, 2018π This is a big release with many improvements and bugfixes.
π See the official changelog for details.
Copy of the changelog
API Changes
 Calculated aesthetics are accessed using the stat() function. The old method (double dots ..name..) still works.
 stat_qq calculates slightly different points for the theoretical quantiles.
 π The scales (when set to free, free_x or free_y') parameter of facet_grid and facet_wrap assigns the same scale across the rows and columns.
π New Features
 Added geom_qq_line and stat_qq_line, for lines through QQ plots.
 Added geom_density_2d and geom_stat_2d.
 β Added stat_ellipse.
 β Added geom_map.
 Plotnine learned to respect plydata groups.
 β Added stat_hull.
 Added save_as_pdf_pages().
π Bug Fixes
 π 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 scale_x_datetime and scale_y_datetime to handle the intercepts along the axes (GH97).
 Fixed stat_bin and stat_bin_2d to properly handle the breaks parameter when used with a transforming scale.
 π Fixed issue with x and y scales where the name of the scale was ignored when determining the axis titles. Now, the name parameter 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 theme(legend_position='none'). (GH119)
 Fixed issue in stat_summary_bin where some input values gave an error. (GH123)
 π Fixed geom_ribbon to sort data before plotting. (GH127)
 π Fixed IndexError in facet_grid when row/column variable has 1 unique value. (GH129)
 π Fixed facet_grid when scale='free', scale='free_x' or scale='free_y', the panels share axes along the row or column.
 π Fixed geom_boxplot so that user can create a boxplot by specifying all required aesthetics. (GH136)
 π Fixed geom_violin to work when some groups are empty. (GH131)
 π Fixed continuous scales to accept minor=None (GH120)
 π Fixed bug for discrete position scales, where drop=False did not drop unused categories (GH139)
 π Fixed bug in stat_ydensity that caused an exception when a panel had no data. (GH147)
 π Fixed bug in coord_trans where coordinate transformation and facetting could fail with a KeyError. (GH151)
 π Fixed bug that lead to a TypeError when aesthetic mappings to could be recognised as being groupable. It was easy to stumble on this bug when using geom_density. (GH165)
 π Fixed bug in facet_wrap where some combination of parameters lead to unexpected panel arrangements. (GH163)
 π Fixed bug where the legend text of colorbars could not be themed. (GH171)

v0.3.0 Changes
November 08, 2017π Big release with known bugs fixed and new features.
A copy of the changelog is pasted below.
API Changes
 ~plotnine.geoms.geom_smooth gained an extra parameter
legend_fill_ratio
that control the area of the legend that is
filled to indicate confidence intervals. (32)  plotnine.ggplot.save gained an extra parameter
verbose
. It no
π¨ longer guesses when to print information and when not to.  plotnine.ggplot.draw gained an extra parameter
return_ggplot
.  If the
minor_breaks
parameter of scales is a callable, it now
expects one argument, thelimits
. Previously it acceptedbreaks
andlimits
.
π New Features
 β Added ~plotnine.animation.PlotnineAnimation for animations.
 β Added ~plotnine.watermark.watermark for watermarks.
 β Added datetime scales for
alpha
,colour
,fill
andsize
aesthetics
β¨ Enhancements
π Changed parameter settings for ~plotnine.stats.stat_smooth.
 Default
span=0.75
instead of2/3
 When using loess smoothing, the control parameter
surface
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 ~plotnine.scales.expand_limits
Low and high ~plotnine.scales.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
(40).stats
also gained new parameterna_rm
, that controls whether
π missing values are removed before statistical computations.~plotnine.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. It can be convenient
π when creating some complicated plots. See the Periodic Table
Example.π Bug Fixes
 π Fixed bug where facetting led to a reordering of the data. This
would manifest as a bug forgeoms
where order was important. (26)  π Fix bug where facetting by a column whose name (eg.
class
) is a
π» python keyword resulted in an exception. (28)  π Fix bug where yaxis scaling was calculated from the
xlim
argument.  π Fix bug where initialising geoms from stats, and positions from
geoms, when passed as classes (e.g.stat_smooth(geom=geom_point)
,
would fail.  π Fixed bug in plotnine.ggplot.save where s
 ~plotnine.geoms.geom_smooth gained an extra parameter

v0.2.1
June 22, 2017 
v0.2.0 Changes
May 18, 2017π Fixes
 Fixed bug in scale_x_discrete and scale_y_discrete where if they were instantiated with parameter limits that is either a numpy array or a pandas series, plotting would fail with a ValueError.
 π Fixed exceptions when using pandas.pivot_table() for Pandas v0.20.0. The API was fixed.
 π Fixed issues where lines/paths with segments that all belonged in the same group had joins that in some cases were βbuttedβ.
API Changes
 geom_text now uses ha and va as parameter names for the horizontal and vertical alignment. This is what matplotlib users expect. The previous names hjust and vjust are silently accepted.
 Layers() can now be used to bundle up geoms and stats. This makes it easy to reuse geoms and stats or organise them in sensible bundles when making complex plots.

v0.1.0 Changes
April 28, 2017π First public release