Bug Fixes

  • Changed the dependency for mizani to v0.5.2. This fixes an issue where facetting may create plots with missing items. (GH210)



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. (GH178)

Bug Fixes

  • Fixed issue where with the subplots_adjust themeable could not be used to set the wspace and hspace Matplotlib subplot parameters. (GH185)
  • Fixed in 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 bug in geom_abline where passing the mapping as a keyword parameter lead to a wrong plot. (GH196)
  • 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 breaks.


  • For all geoms, with coord_cartesian float('inf') or np.inf are interpreted as the boundary of the plot panel.
  • Discrete scales now show missing data (None and nan). This behaviour is controlled by the new na_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.



API Changes

  • Calculated aesthetics are accessed using the stat() function. The old method (double dots 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

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)



API Changes

  • geom_smooth gained an extra parameter legend_fill_ratio that control the area of the legend that is filled to indicate confidence intervals. (GH32)
  • 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, the limits. Previously it accepted breaks and limits.

New Features

  • Added PlotnineAnimation for animations.
  • Added watermark for watermarks.
  • Added datetime scales for alpha, colour, fill and size aesthetics


  • Changed parameter settings for stat_smooth.

    1. Default span=0.75 instead of 2/3
    2. 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 expand_limits()

  • 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 (GH40).

    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 aesthetics (GH169).

  • You can now specify infinite coordinates with plotnine.geoms.geom_rect (GH166)

Bug Fixes

  • Fixed bug where facetting led to a reordering of the data. This would manifest as a bug for geoms where 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 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 where specifying the width and height would mess up the strip_text and spacing for the facetted plots. (GH44).
  • Fixed bug in geom_abline, geom_hline and geom_vline where facetting on a column that is not mapped to an aesthetic fails. (GH48)
  • Fixed bug in geom_text, the fontstyle parameter was being ignored.
  • Fixed bug where boolean data was mapped to the same value on the coordinate axis. (GH57)
  • Fixed bug in facet_grid where the scales sometimes has no effect. (GH58)
  • Fixed bug in stat_boxplot where setting the width parameter caused an exception.



  • Fixed bug where manually setting the aesthetic fill=None or 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_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 facet_wrap when the scales are allowed to vary (e.g scales='free') between the panels.
  • Fixed bug in stat_density where changing the x limits lead to an exception (GH22)



  • 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.



First public release