This is a re-release of v0.10.0.
In the previous release the project description fileformat changed and not all references to it were corrected. PYPI read file that did not exist, got no description. This release is fixes error.
geom_ribbonacquired new parameter
wherewhich can be used shade withing given limits .
Added support for objects with a
to_pandasmethod to convert them to a pandas dataframe. You can now pass in polars dataframes.
The automatic groups generated by the system and depending on the aesthetic mappings now only depend those aesthetics that have scales. This is more strict than has been, should affect very few cases of code that has been written and it should be less suprising to the users.
For the calls to
ggplot, the order of the positional arguments is
(data, mapping)and for calls
statsthe order is
(mapping, data). In practice, you can still provide one/two positional arguments in any order. However, the are a few cases where old code will breaks due to duplicate parameters.
geom_pointdensity, a 2D density plot that does not hide the distribution of the individual data points.
theme_tufte, a theme that reduces the distractions around plot data.
You can now align the
plot_titlehorizontally to the left or right.
Before, the title was always centered.
Fixed bug where you could not specific the cap/end of a dashed line when styling a plot with
geom_historyfor some cases when it fails to automatically determine the number of bins. (GH543)
geom_mapto be able to draw Polygons with holes in them.
geom_mapto be able to draw MultiPolygons.
Fixed scales to work with limits passed as a function.
axis_ticksso you can change the colour of the axis ticks. This was probably a regression due to changes in Matplotlib.
panel_ontopso that if is set to
False, then the data visualised below the grid-lines. (GH585)
stat_densitynow uses a fast computation path for gaussian densities with no weights. This was probably a regression.
geom_mapcan now draw MultiPoints, MultiLineStrings and MultiPolgons.
adjust_textcan now be used in more than one layer with good enough results.
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_violingained the a new parameter
stylewith which you can draw half violin (density curve on one side and flat on the other).
geomsgained new parameter
Layer. You can use it to rasterize any layer when the resulting plot is of vector format e.g.
facet_gridgained the ability to have rows and columns of panels of different sizes.
Fixed issue where some plots with a colorbar would fail for specific themes. (GH424)
geom_textto allow any order of
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_familyof 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
Noneto 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.0where 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_continuousto refer to the same scale as
plotnine.scale.scale_color_cmapso the parameter cmap_name refers to the name of the color palette and name refers to the name of the scale. (GH371)
aesgot an internal function
reorderwhich makes it easy to change the ordering of a discrete variable according to some other variable/column.
stat_smoothcan now use formulae for linear models.
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_violinand other geoms when used with
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_dodgeto work when
coloris used as an aesthetic. (GH372)
plotnine.geoms.geom_maphas 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_sumhas changed to
'stat(n)'. This also changes the default plot for
adjust_textparameter, and can now repel text.
Added scales for ordinal (ordered categorical) columns.
geom_stepgained the option
midfor 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_dodgewhere by bar plot could get thinner when facetting and useing
preserve = 'single'. (GH224)
Fixed bug in
coord_transwhere if the transformation reversed the original limits, the order in which the data was laid out remained unchanged. (GH253)
Fixed bug where one could not use the British spelling
colourto 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_spokecan 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.
stat_smoothcan now differentiate between arguments for initialising and those for fitting the smoothing model.
position_nudgecan now deal with more geoms e.g.
widthof the boxplot can now be set irrespective of the stat.
The mid-point color of
scale_color_distillernow 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
themeso they can be suggested autocomplete.
Changed the dependency for mizani to
v0.5.2. This fixes an issue where facetting may create plots with missing items. (GH210)
Fixed issue where with the subplots_adjust themeable could not be used to set the wspace and hspace Matplotlib subplot parameters. (GH185)
stat_binwhere 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_breaksfor 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.infare interpreted as the boundary of the plot panel.
Discrete scales now show missing data (
nan). This behaviour is controlled by the new
minor_breaksparameter 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
stat()function. The old method (double dots
..name..) still works.
stat_qqcalculates 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
nameof the scale was ignored when determining the axis titles. Now, the
nameparameter 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=Falsedid 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
verbose. It no longer guesses when to print information and when not to.
plotnine.ggplot.draw()gained an extra parameter
minor_breaksparameter of scales is a callable, it now expects one argument, the
limits. Previously it accepted
Changed parameter settings for
When using loess smoothing, the control parameter
surfaceis 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
scalelimits can now be expanded separately with different factors multiplicative and additive factors.
The layer parameter show_legend can now accept a
dictfor finer grained control of which aesthetics to exclude in the legend.
Infinite values are removed before statistical computations
statsalso 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. It 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 aesthetics (GH169).
Fixed bug where facetting led to a reordering of the data. This would manifest as a bug for
geomswhere order was important. (GH26)
Fix bug where facetting by a column whose name (eg.
class) is 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.
stat_smooth(geom=geom_point), would fail.
Fixed bug in
fontstyleparameter was being ignored.
Fixed bug where boolean data was mapped to the same value on the coordinate axis. (GH57)
Fixed bug in
stat_boxplotwhere setting the
widthparameter caused an exception.
Fixed bug where manually setting the aesthetic
fill='None'could lead to a black fill instead of an empty fill.
Fixed bug where computed aesthetics could not be used in larger statements. (GH7)
Fixed bug in
stat_summarywhere 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
facet_wrapwhen the scales are allowed to vary (e.g scales='free') between the panels.
Fixed issues where lines/paths with segments that all belonged in the same group had joins that in some cases were "butted".
vaas parameter names for the horizontal and vertical alignment. This is what matplotlib users expect. The previous names
vjustare silently accepted.
Layers()can now be used to bundle up
stats. This makes it easy to reuse
geomsand stats or organise them in sensible bundles when making complex plots.
First public release