Changelog
Source:NEWS.md
ggpp 0.5.8-1
CRAN release: 2024-07-01
- Fix wrong test for availability of ‘gginnards’ in examples (reported by Joshua Ulrich in issue #53).
- Add to vignette Combining repulsion and nudging three missing tests for availability of package ‘ggrepel’.
- Revise
position_nudge_to()
to support expansion and contraction of the range within which to spread the positions.
ggpp 0.5.7
CRAN release: 2024-05-06
Track changes in ‘ggplot2’ 3.5.0 and 3,5,1. Fix a couple of minor incompatibilities. Add some new features matching those new in ‘ggplot2’. General improvements and bug fixes.
- This version depends on ‘ggplot2’ >= 3.5.0.
- Add helper function
wrap_labels()
, useful to insert new lines into characters strings stored in a vector. - Add
as_npc()
,as_npcx()
andas_npcy()
helper functions that translate positions given as character strings into numeric values in [0..1] corresponding to NPC (Normalised Parent Coordinates) and validate the range of numeric values if passed directly as arguments. The returned values belong to classAsIs
and ready to use in aesthetic mappings. - Update
geom_point_s()
adding parametermove.point
to allow its use to highlight points at the original position with an arrow with its start given by the displacement by a position function. - Change in
geom_point_s()
the end at which the tip of the arrow is drawn, to its most frequently used direction, even if opposite to the default forgeom_text_s()
andgeom_label_s()
. - Update
geom_text_s()
,geom_label_s()
.geom_text_pairwise()
andgeom_label_pairwise()
adding parametersize.unit
tracking change ingeom_text()
andgeom_label()
in ‘ggplot2’ >= 3.5.0. - Update
geom_text_s()
,geom_label_s()
.geom_text_pairwise()
andgeom_label_pairwise()
so that graphic elements in the keys match those in the plot, even when using the additional features available in ‘ggplot2’ in >= 3.5.0. - Update
geom_text_s()
,geom_label_s()
.geom_text_pairwise()
andgeom_label_pairwise()
so that they respect thealpha
component of color defintions. - Update
stat_fmt_table()
to allow application of functions to columns. - Fix in
geom_text_s()
,geom_label_s()
.geom_text_pairwise()
andgeom_label_pairwise()
an infrequent problem with incomplete guides in ‘ggplot2’ >= 3.5.0. - Fix bug in
geom_point_s()
,alpha_target = "point"
ignored. - Fix bug in
geom_label_s()
,colour_target = "box.line"
ignored. - Fix bug in in
shrink_segments()
giving a spureous error with totel shrinkage > 1 mm. Affecting all geometries with formal parametersbox.padding
andpoint.padding
.
ggpp 0.5.6
CRAN release: 2024-01-09
- Fix bug in
stat_density2d_filter()
. - Fix bug in
position_dodgenudge()
, behaviour likeposition_dodge2nudge()
. - Improve handling of nudging with
x
ory
nudge vectors longer than one but shorter than the number of rows indata
by reordering them based on the ordering of the data values to which they are applied.
ggpp 0.5.5
CRAN release: 2023-11-07
- Update for compatibility with upcoming ‘ggplot2’ >= 3.5.0.
- Support the
angle
aesthetic ingeom_label_npc()
,geom_label_s()
andgeom_label_pairwise()
matching the upcoming update toggplot2::geom_label()
(with help from teunbrand). - Add support for
linetype
aesthetic togeom_label_npc()
, for consistency withgeom_label_s()
andgeom_label_pairwise()
. - Add
position_stack_minmax()
to correctly position error bars in stacked plots. - Add data sets
birch.df
andbirch_dw.df
with data for 350 birch seedlings. - Add data set
weather_18_june_2019.df
with data at 1 min intercal for 24 h. - Move transcriptomics data sets
quadrant_example.df
andvolcano_example.df
from ‘ggpmisc’ to ‘ggpp’.
ggpp 0.5.4
CRAN release: 2023-08-12
- Add
geom_text_pairwise()
andgeom_label_pairwise()
suitable for annotating/highlighting pairwise comparisons between levels of a factor mapped to the x aesthetic. They can also be used to highlight ranges of values when the variable mapped to x is a continuous numerical vector. The user interfaces are consistent with those ofgeom_text_s()
andgeom_label_s()
. - Improve handling of nudge values when dates or times are mapped to x or y.
ggpp 0.5.3
CRAN release: 2023-07-16
- Add support for percent and fraction of observations to
stat_quadrant_counts()
andstat_group_counts()
. - Fix bug in
stat_group_counts()
: mismatch between counts and groups. - Add
stat_functions()
, a replacement forggplot2::stat_function()
that fully complies with the grammar of graphics, supporting multiple functions per layer, grouping and facets. - Add examples to documentation.
ggpp 0.5.2
CRAN release: 2023-04-01
- Fix bug in
stat_dens2d_labels()
,stat_dens2d_filter()
,stat_dens2d_filter_g()
,stat_dens1d_labels()
,stat_dens1d_filter()
andstat_dens1d_filter_g()
: handle elegantly data for which density cannot be estimated (Issue #32 raised by mshubert to report bug). - In
stat_dens2d_labels()
,stat_dens2d_filter()
,stat_dens2d_filter_g()
,stat_dens1d_labels()
,stat_dens1d_filter()
andstat_dens1d_filter_g()
usetype = 8
when computing quantiles, instead of the defaulttype = 7
. Type 8 is recommended as better with data that are not normally distributed. - Add parameter
exclude.these
tostat_dens2d_labels()
,stat_dens2d_filter()
,stat_dens2d_filter_g()
,stat_dens1d_labels()
,stat_dens1d_filter()
andstat_dens1d_filter_g()
allowing forcing the exclusion of specific observations irrespective of the local density (See issue #19, partly addressing a suggestion by mshubert). - In
stat_dens2d_labels()
,stat_dens2d_filter()
,stat_dens2d_filter_g()
,stat_dens1d_labels()
,stat_dens1d_filter()
andstat_dens1d_filter_g()
add parameterthese.target
making it possible to apply a function or vector of values passed throughexclude.these
orkeep.these
to any variable in the layerdata
(See issue #19, partly addressing a suggestion by mshubert). - Implement
"spread"
action inposition_nudge_to()
. - Fix bug in segment shrinking (very rare division by zero).
- Changed default values for
colour.target
to improve consistency; now segments are never the target of colour by default. - Add formal parameters
color.target
anddefault.colors
as synonyms ofcolour.target
anddefault.colours
. - Add unit tests. (See issue #10, and pull requests #12, #13, #17, #18, #21, #23, #24, #25, #26, #27, #30, #31, #34 and #38 from Daniel Sabanes Bove and his team).
- Add checks for string arguments; improve some obscure error messages.
- Track deprecation of
aes_string()
in ‘ggplot2’ (>= 3.0.0).
ggpp 0.5.1
CRAN release: 2023-02-03
- Add parameter
keep.these
tostat_dens2d_labels()
,stat_dens2d_filter()
,stat_dens2d_filter_g()
,stat_dens1d_labels()
,stat_dens1d_filter()
andstat_dens1d_filter_g()
allowing forcing the inclusion of specific observations irrespective of the local density (See issue #19, partly addressing a suggestion by mshubert). - Update
stat_dens2d_labels()
,stat_dens2d_filter()
,stat_dens2d_filter_g()
,stat_dens1d_labels()
,stat_dens1d_filter()
andstat_dens1d_filter_g()
to allow separate control of kept observations or labels in each tail (1D) or in each quadrant (2D) of the density distribution, still using an estimate of the local density computed from the whole data set. - Add parameter
return.density
tostat_dens2d_labels()
,stat_dens2d_filter()
,stat_dens2d_filter_g()
,stat_dens1d_labels()
,stat_dens1d_filter()
andstat_dens1d_filter_g()
to request the local density estimate at the position of each observation to be returned in numeric variabledensity
and the outcome of the test in logical variablekeep
.
ggpp 0.5.0
CRAN release: 2022-12-05
- Add
stat_panel_counts()
andstat_group_counts()
. - Add parameters
default.colour
andcolour.target
togeom_label_s()
,geom_text_s()
,geom_point_s()
,geom_plot()
,geom_table()
andgeom_grob()
. - Add parameters
default.alpha
andalpha.target
togeom_label_s()
,geom_text_s()
,geom_point_s()
,geom_plot()
,geom_table()
andgeom_grob()
. -
Code breaking. Remove support for aesthetics
segment.colour
,segment.alpha
, andsegment.size
ingeom_label_s()
,geom_text_s()
,geom_point_s()
,geom_plot()
,geom_table()
andgeom_grob()
. (Segments are links, and not meant to inform about data values on their own.) - Add vignette “Combining repulsion and nudging” describing the plot features made possible by packages ‘ggpp’ (>= 0.5.0) and ‘ggrepel’ (>= 0.9.2) when used together.
ggpp 0.4.5
CRAN release: 2022-09-30
- Add function
dark_or_light()
. - Support the new ‘ggplot2’ aesthetic
linewidth
ingeom_quadrant_lines()
andgeom_vhlines()
for compatibility with ‘ggplot2’ (>= 3.3.7). - Update
geom_text_s()
andgeom_label_s()
to support justification computed from positions, withhjust = "position"
andvjust = "position"
as new defaults. (The current, very simple, approach will be further tested and if necessary improved for the next release.) - Update
geom_text_s()
andgeom_label_s()
to enablesegment.size
aesthetic and increase its default value, and add formal parameterspoint.padding
,box.padding
andmin.segment.length
to allow adjusting the length of the segments. - Update
position_nudge_center()
for compatibility with ‘ggplot2’ (>= 3.3.7) and to ensure that every label gets nudged even if located exactly at the center (focus point of nudging).
ggpp 0.4.4
CRAN release: 2022-04-10
Multiple grobs and grob trees sharing the same name result in only the first one being rendered. This caused problems when multiple layers created with the same geometry were added to a plot.
- Fix bug caused by grob and grob tree naming. Until unique naming is implemented, we do not assign names in cases where these potentially can interfere with rendering. This bug affected most geometries in ‘ggpp’.
ggpp 0.4.3
CRAN release: 2021-12-17
Based on issues raised in the GitHub repository of ‘ggrepel’ and the nudge functions added some time ago to package ‘ggpp’ it became obvious that nudging can help in achieving good repulsion outcomes without need of tailored repulsion algorithms for specific cases. Obviously developing new ggplot position functions is much easier than tweaking the repulsion algorithm. It is also clear that not being able to combine nudging with stack, jitter and dodge positions made difficult to produce some types of plots. One case is replacing a key or legend with direct labels to plot elements, which is important in plots aimed at audiences outside academia.
In one of the issues in the GitHub repository of ‘ggrepel’ an answer by M. Krassowski included code that provided an elegant and simple approach to implementing combined position functions without duplicating code already in ‘ggplot2’ by instead calling methods of the parent class. I edited this code and included it in the package.
Except for the position functions with names ending in _keep
, for which normal counterparts exist, the keeping of the original position can be disabled by passing kept.origin = "none"
when they are called.
The renaming of geom_text_linked()
to geom_text_s()
is code breaking but I am now fairly confident this shorter name is easy to remember with s
for segment.
- Add functions
position_stack_keep()
,position_fill_keep()
,position_jitter_keep()
,position_dodge_keep()
andposition_dodge2_keep()
. - Add functions
position_stacknudge()
,position_fillnudge()
,position_jitternudge()
,position_dodgenudge()
andposition_dodge2nudge()
based on code by M. Krassowski forposition_stack_and_nudge()
. - Revise functions
position_nudge_to()
,position_nudge_center()
andposition_nudge_line()
adding support for disabling keeping of the original positions. - Add
geom_point_s()
andgeom_label_s()
and updategeom_text_s()
renamed fromgeom_text_linked()
. This is a code breaking change with respect to the previous (unstable) version. - Update
geom_plot()
,geom_table()
andgeom_grob()
to support plotting of segments when positions change, e.g., with nudging. - Update the vignette.
With 12 new and four partly rewritten functions there is quite a lot of new code in this update, so even if tested and checked, it is possible that bugs may have slipped through. Please, do report them if you encounter any.
ggpp 0.4.2
CRAN release: 2021-07-31
The initial implementation and user interface of three apply statistics first introduced in ‘ggpmisc’ 0.3.6 has been revised to expand their usefulness and to make them less error-prone, while the fourth one is now defunct. Note: The default argument for geom
instat_centroid()
is likely to change in the near future. Otherwise, the three statistics can be considered now stable.
Update
stat_apply_group()
to support summary functions likequantile()
that return vectors with more than one value but shorter than the original number of observations.Update
stat_summary_xy()
andstat_apply_group()
to returnNA
inx
and/ory
when.fun.x
or.fun.y
are not passed an argument. This is a code breaking change with respect to the previous (unstable) version.Update
stat_summary_xy()
andstat_centroid()
to support functions that return a one row data frame, like those defined in ‘ggplot2’ to be passed as argument to parameterfun.data
ofggplot2::stat_summary()
, such asmean_se
,mean_cl_boot
, etc.Fix bug in
stat_centroid()
,stat_summary_xy()
andstat_apply_group()
resulting in the return of a long data frame withNA
values instead of a data frame with fewer rows.Remove
stat_apply_panel()
, as it was redundant. Grouping can be modified per layer when needed.
ggpp 0.4.1
CRAN release: 2021-07-14
Update
compute_just2D()
andcompute_just()
to work with any value for theangle
aesthetic, as in the accepted version of the pull request in ‘ggplot2’.Fix bug in
geom_table()
that would cause text left or right justified to be clipped when the text in a cell was very long (reported by dryguy). (Cell padding still needs improvement.)
ggpp 0.4.0
CRAN release: 2021-05-28
This new package is the result of splitting package ‘ggpmisc’ into two packages: ‘ggpp’ containing extensions to the grammar of graphics and ‘ggpmisc’ containing extensions to ‘ggplot2’ related to plot decorations based on model fits, statistical summaries and other descriptors of the data being plotted. Package ‘ggpmisc’ depends on ‘ggpp’ with no visible changes for users. Package ‘ggpp’ can be loaded instead of ‘ggpmisc’ when only the extensions it contains are needed. Package ‘gginnards’ containing tools for editing ggplot objects as well as tools for inspecting them is an earlier spin-off from ‘gpmisc’.
Compared to ‘ggpmisc’ 0.3.9, the following changes have been introduced. New justification styles have being implemented to complement position_nudge_center()
. They are supported in geom_text_s()
, geom_plot()
, geom_table()
, geom_grob()
and geom_marging_grob()
. In the current implementation all rows in data
should contain the same hjust
or vjust
value when using the new types of justification described here, this seems reasonable as they compute the individual justification values from the data. All other justification values, either numeric
or character
do not have this restriction and can be used as in geoms from ‘ggplot2’. These new features may change in the near future.
- Rename
geom_linked_text()
intogeom_text_linked()
. - Implement justifications
"outward_mean"
,"inward_mean"
,"outward_median"
and"inward_median"
so that outward and inward are with respect to the centroid of the data instead of to the middle of the or scales. This should be useful in combination withposition_nudge_center()
. - Implement justifications
"outward_nnn"
and"inward_nnn"
so that outward and inward are with respect to the number resulting from applyingas.numeric()
to the characters that replacennn
. For example strings like"outward_0.5"
,"inward_3e5"
or"outward_-3e-2"
are supported. This should be useful when manual tweaking is desired. As special cases"outward_0"
and"inward_0"
apply justification outward and inward with respect to the origin. This should be useful for biplots used for PCA and similar cases with arrows radiating out of the origin. (The"outward"
and"inward"
justification implemented in ‘ggplot2’ is relative to the middle of the or scales.) - Revise
compute_npcx()
andcompute_npcy()
to support multiple steps per group (needed in ‘ggpmisc’). - Fix problem related to
"outward"
and"inward"
justification of text labels whenangle
aesthetic takes values < -45 or > 45 degrees. This code change alters how old plots are rendered if text labels have been rotated by more than 45 degrees. - ‘ggplot2’, ‘ggrepel’: The problem with angle was a “bug” in ‘ggplot2’ also present in ‘ggrepel’. A pull request for
ggplot2::geom_text()
has been submitted and merged. This is now in the ‘ggplot2’ 3.3.4 milestone retaining consistent behaviour between ‘ggplot2’, ‘ggrepel’, ‘ggpp’ and ‘ggpmisc’.