Skip to content

Releases: has2k1/plotnine

v0.14.0

29 Oct 11:00
v0.14.0
Compare
Choose a tag to compare

API Changes

  • You cannot call print on a ggplot object to show it. This was deprecated in v0.13.0 and it has now been removed. Use ggplot.show()

  • The color_space parameter of scale_color_hue now accepts the value "hlsuv" instead of "husl". The meaning of has not changed, and "husl" is silently accepted.

  • Themeables axis_ticks_direction, axis_ticks_direction_x and axis_ticks_direction_y have be deprecated. In their place, the direction of the ticks can be controlled by using +ve, -ve or complex values for the axis_ticks_length, axis_ticks_length_major, axis_ticks_length_major_x, axis_ticks_length_major_y, axis_ticks_length_minor, axis_ticks_length_minor_x, or axis_ticks_length_minor_y.

Enhancements

  • The family, fontstyle and fontweight parameters of geom_text are now aesthetics (#790).

  • plotnine now responds to the fig-width, fig-height and fig-format settings in the meta section of a quarto document.

  • ggtitle now accepts title and subtitle as keyword arguments. (#804)

  • Gained the option limitsize that makes it possible to display plots of any size.

    from plotnine.options import set_option
    
    set_option("figure_format", False)
  • For geom_boxplot when the outliers are made invisible by giving them no shape, now they do not affect the limits of the plot. (#814)

  • Made it possile to map an aesthetic value to None. (#791)

  • The signatures for the scale classes now list all the allowed parameters.

New Features

  • geom_text has gained new aesthetics fontvariant and fontstretch.

Bug Fixes

  • Fix layers 3 and above not to overlap the axis lines if there are any (#798).

  • Fixed bug in geom_segment where the lineend parameter was ignored. (#727)

  • Fixed stat_summary_bin to work with continuous x aesthetic when specifying the binwidth or breaks. (#824)

  • Fixed PlotnineAnimation not to draw a second legend at the bottom-left corner. (#816)

  • Fixed bug where setting theme(text=element_blank()) would raise and exception.

  • Fixed datetime and timedelta scales so they can be expanded by
    adding constant timedelta values.

v0.13.6

10 May 08:15
v0.13.6
Compare
Choose a tag to compare

Bug Fixes

  • Fixed geom_label to work with a boxstyle of any following square, circle, darrow, larrow, rarrow, roundtooth or sawtooth.(#779)

Enhancements

  • Stopped spurious warnings of the form PlotnineWarning: Failed to apply after_scale modifications to the legend. when the after_scale mapping is for another aestetic.
  • Added width and height as default aesthetics of geom_tile.

v0.13.5

26 Apr 19:26
v0.13.5
Compare
Choose a tag to compare

Bug Fixes

  • Fixed bug in stat_smooth where you could not set the family when using a glm. (#769)
  • Fixed bug in position_dodge2 the widths of the dodged objects were mixed up. (#772)
  • Fixed geom_text to work better with adjustText v1.0.0 and above.
  • Fixed images generated in quarto so that they have the dimensions (taking the dpi into account) that are specified in theme. (#773)

New

  • Added themeable svg_usefonts. (#756)
  • Enhancements
  • Added palmerpenguins dataset.

v0.13.4

03 Apr 14:18
v0.13.4
Compare
Choose a tag to compare

Bug Fixes
Fixed regression in v0.13.3 where setting some text elements element_blank led to an error. #764

v0.13.3

27 Mar 14:40
v0.13.3
Compare
Choose a tag to compare

This is a small bug fix release.

Bug Fixes

  • Fixed layout manager to make space for the strip_text when there is no strip_background. (#760)
  • Made the default position of guide_legend text to be right. (#761)
  • Fixed aligning (ha & va) of plot_title, plot_subtitle, plot_caption, axis_title_x, axis_title_y to work with float values in the range [0, 1].

v0.13.2

15 Mar 09:00
v0.13.2
Compare
Choose a tag to compare

This release has a single enhancement. When drawing a plot, pandas copy-on-write is turned off. This prevents errors for users
who have turned it on. A later release will make plotnine capable of working with copy-on-write on.

v0.13.1

06 Mar 19:17
v0.13.1
Compare
Choose a tag to compare

v0.13.1

Bug Fixes

  • Fixed a bug where a legend with blank title or text could result in a wrong justification.

  • Fixed a bug where setting legend justification to a string i.e one of left, right, top, bottom, center had no effect.

v0.13.0

20 Feb 15:33
v0.13.0
Compare
Choose a tag to compare

API Changes

  • Requires python >= 3.9

  • Using the print or repr functions to draw and show the plot has been deprecated. Use ggplot.show().

  • The name of the calculated aesthetic of stat_function changed from y to fx.

  • stat_ecdf has gained the pad parameter. The default is set to True, which pads the domain with -inf and inf so that the ECDF does not have discontinuities at the extremes. To get the behaviour, set pad to False. (#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 and guide_legend have been removed. For their place, the theme parameter has been introduced and it gives better control of the look and feel.

  • Themeables legend_entry_spacing, legend_entry_spacing_x and legend_entry_spacing_y have been renamed to legend_key_spacing, legend_key_spacing_x and legend_key_spacing_y respectively

  • facet_grid now accepts two parameters, rows and cols, 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 in facet_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 and scale_y_symlog

  • Gained themeables

    to set the plot margin on each side independently.

  • Gained themeables

    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 and size guides at the bottom, and the color 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 of facet_grid now responds to the values free, free_x and free_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 and axis_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 named key. (#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)

Enhancements

  • All __all__ variables are explicitly assigned to help static typecheckers infer module attributes. (#685)

  • You can now pickle the drawn matplotlib figures. (#729)

  • The facet titles in the strip_text are now better aligned are appear more centered withing the strip_background.

v0.12.4

06 Nov 11:06
v0.12.4
Compare
Choose a tag to compare

This is a maintenance release with a few changes, see the changelog.

v0.12.3

01 Sep 18:57
v0.12.3
Compare
Choose a tag to compare

A maintenance release. See changelog.