has2k1/plotnine: v0.15.0
Creators
- Hassan Kibirige
- Greg Lamp
- Jan Katins
- gdowding
- austin
- Florian Finkernagel
- matthias-k
- Tyler Funnell
- Jonas Arnfred
- Dan Blanchard1
- Paul Natsuo Kishimoto2
- Sergey Astanin
- Eric Chiang3
- stonebig
- Evan Sheehan
- Bernard Willers
- Michael Chow4
- Jeroen Janssens5
- Simon Mutch6
- Yaroslav Halchenko7
- PGK
- Josh Hartmann
- John Collins
- Tim Gates8
- Min RK9
- Michał Krassowski10
- Jonathan Soma11
- James Spencer
- Hugo van Kemenade12
- Gregory Power
- 1. @coiled
- 2. International Institute for Applied Systems Analysis @iiasa
- 3. @oblique-security
- 4. @rstudio
- 5. @posit-dev
- 6. The University Of Melbourne
- 7. Dartmouth College, @dandi, @Debian, @DataLad, @neurodebian, @PyMVPA, @fail2ban
- 8. IRESS
- 9. Simula Research Laboratory
- 10. @Quansight @openteams-ai
- 11. Brooklyn Brainery
- 12. @sovereigntech
Description
API Changes
- Themeables
axis_ticks_pad
,axis_ticks_pad_minor
,axis_ticks_pad_major
,axis_ticks_pad_minor_x
,axis_ticks_pad_minor_y
,axis_ticks_pad_major_x
andaxis_ticks_pad_major_y
have been deprecated. Use themargin
parameter ofelement_text
withaxis_text
,axis_text_x
oraxis_text_y
to control the spacing between the axis text and the ticks. (#843) - The
stat
class methodsstat.compute_layer
,stat.compute_panel
andstat.compute_group
are now instance methods and they no longer accept**params
arguments. Access to the parameters is throughself.params
. - The
geom
class methodsgeom.draw_layer
andgeom.draw_panel
do no longer accept**param
arguments. Access to the parameters is throughself.params
. - Method
geom.draw_group
now accepts theparams
argument as a dictionary and not**params
.
New Features
Plot Composition is here. Using an intuitive algebra, you can now put combine multiple plots into a single graphic. e.g.
p1 = ggplot(...) p2 = ggplot(...) p3 = ggplot(...) (p1 | p2) / p3
Using
plot_title_position
andplot_caption_position
e.g.theme( plot_title_position="plot", plot_caption_position="plot", )
You can now position the
plot_title
,plot_subtitle
andplot_caption
by alignment them with respect to the plot. (#838)Gained new label
tag
to create a tag for a plot. You can set it withlabs
e.g.labs(tag="A")
and customise it using these themeables
plot_tag
andplot_tag_position
andplot_tag_location
e.g.theme( plot_tag="plot", plot_tag_location="plot", plot_tag_position="topright", )
Geoms
geom_bar
andgeom_col
have gained new parameterjust
that controls how the bars align with the axis break point.geom_sina
has gained new parameterstyle
just likegeom_violin
, which make one-sided (half) sina plots.Gained the Anscombe Quartet dataset,
anscombe_quartet
.Gained new module
plotnine.helpers
to be a place for some helper functions.Gained new helper function
get_aesthetic_limits
.geom_point
gained the ability to handle shapes of the formSequence[tuple[float, float]]
e.g.((-2, -4), (-2, -1), (0, 1), (2, -1), (2, -4), (-2, -4))
Which declares the vertices of a polygon shape.
Enhancements
- Included datasets
mpg
,msleep
andmidwest
no longer have any of their columns as categoricals. This matches the respective datasets in R. (#913) - When the
width
of the violins ingeom_violin
is wider than their normal area, they now overlap with those closest to the origin on top. This makes it possible to create overlapping ridge plots using half violins. legend_key
now inherits frompanel_background
and the default themes have been adjusted to rely on this inheritance. So when using the default themes, alteringfill
parameter of thepanel_background
will also affect the background of thelegend_key
.- The default value for the
guide
parameter for the identity scales (scale_*_identity
) has been reverted toNone
. This means by default using these scales will not generate a legend.
Bug Fixes
- Fixed bug in with the
legend_key_height
themeable where it wasn't applied. (#921) - Fixed bug where justifying
axis_text_x
andaxis_text_y
using horizontal and vertical alignment did not work as expected. (#927) - Fixed justifying strip_text within the strip_background. (#867)
- Fixed bug where faceting along a column with unused categories could raise an error. (#930)
- Fixed bug where computed aesthetic from
after_scale
are were not applied to the legend. (#926) - Fixed theming of minor x axis ticks.
- Fixed theming of
axis_text
,axis_text_x
andaxis_text_y
so when they can be overriden if previously set toelement_blank()
. - Fixed
strip_text_x_background
s to always have equal heights andstrip_text_y_background
s to have equal widths. This applies to cases where the texts have unequal number of lines or they are rotated but have different lengths. - Fixed the empty space below the plot title (or subtitle) when
strip_text_x_background
s are partly or fully aligned within the panel. This space (hole), was not accounted for by any of the themeables. This affectedtheme_xkcd
and anytheme
settings that tried to slide the text / background into the panel. - Fixed the empty space to the left the right margin when the
strip_text_y_background
s are partly or fully aligned within the panel. This space (hole), was not accounted for by any of the themeables. This affectedtheme_xkcd
and anytheme
settings that tried to slide the text / background into the panel. - Fixed bug in
geom_histogram
where mapping to theweight
aesthetic lead to an error. (#936) - Fixed bug in
geom_vline
where you could not map thexintercept
aesthetic to a discrete variable. - Fixed bug in
geom_hline
where you could not map theyintercept
aesthetic to a discrete variable. - Fixed bug in all manual scales (
scale_*_manual
) where if you setvalues
to adict
then setting the breaks would lead to an error. (#949) - Fixed using
theme_void
with facetting so that the strip text are always fully within the figure bounds. - Fixed the ordinal color scales
scale_color_ordinal
,scale_color_cmap_d
scale_fill_ordinal
andscale_fill_cmap_d
to handle missing (NaN
orNone
) values. (#953)
Files
has2k1/plotnine-v0.15.0.zip
Files
(7.2 MB)
Name | Size | Download all |
---|---|---|
md5:4f08f40492fdde143d307503c13228e4
|
7.2 MB | Preview Download |
Additional details
Related works
- Is supplement to
- Software: https://github.com/has2k1/plotnine/tree/v0.15.0 (URL)
Software
- Repository URL
- https://github.com/has2k1/plotnine