- Fixes bug in "image" pattern when
pattern_type = "tile"
(#37). Transparent parts of tiled images are now consistently transparent. We now support thepattern_gravity
aesthetic whenpattern_type = "tile"
.
-
To turn off "clipping" certain built-in patterns with the new R 4.1 graphic features and instead use a raster image approximation one should now use
options(ggpattern_use_R4.1_masks = FALSE)
instead ofoptions(ggpattern_use_R4.1_clipping = FALSE)
. Alternatively, usingoptions(ggpattern_use_R4.1_features = FALSE)
to turn off all R 4.1 features will continue to work. -
{ggpattern} removes the following data/functions which were deprecated in a previous version of {ggpattern}:
convert_polygon_df_to_polygon_grob()
convert_polygon_df_to_polygon_sf()
convert_polygon_sf_to_polygon_df()
-
Defunct functions are no longer exported.
- {ggpattern} now supports
geom_histogram_pattern()
(#71)
-
geom_sf_pattern()
andgeom_polygon_pattern()
now support polygons with holes by using "alpha masking" instead of a "clipping path". If R 4.1 alpha mask feature is not supported by the active graphics device (or the masking feature is declined) we use a raster image approximation of the pattern. Resolution of the raster approximation can be adjusted by thepattern_res
aesthetic whose default in turn can be adjusted by the"ggpattern_res"
global option.This change fixes patterns filling holed polygons in certain graphic devices (#68). This change fixes patterns sometimes escaping plot window (#60).
-
draw_key_polygon_pattern()
,GeomMapPattern
,GeomPolygonPattern
, andGeomSfPattern
now draws a "border" grob on top of the "pattern" grob (#72). -
Continuous "pattern_colour", "pattern_fill", and "pattern_fill2" color scales' default "colourbar" guide support should now work.
-
scale_pattern_size_continuous()
now uses "pattern_size" aesthetic instead of "size" aesthetic in underlyingggplot2::continuous_scale()
call. -
We now export
scale_pattern_alpha()
which is an alias ofscale_pattern_alpha_continuous()
.
{ggpattern} removes the following data/functions which were deprecated in a previous version of {ggpattern}:
calculate_bbox_polygon_df()
convert_img_to_array()
convert_polygon_df_to_alpha_channel()
create_gradient_img()
fetch_placeholder_img()
fill_area_with_img()
magick_filter_names
, instead usemagick::filter_types()
magick_gravity_names
, instead usemagick::gravity_types()
magick_pattern_intensity_names
, instead usegridpattern::names_magick_intensity
magick_pattern_names
, instead usegridpattern::names_magick
magick_pattern_stripe_names
, instead usegridpattern::names_magick_stripe
placeholder_names
, instead usegridpattern::names_placeholder
rotate_polygon_df()
{ggpattern} now deprecates the following data/functions, they may be removed in a future version of {ggpattern}:
convert_polygon_df_to_polygon_grob()
convert_polygon_df_to_polygon_sf()
convert_polygon_sf_to_polygon_df()
-
{ggpattern} now supports the following aesthetics (#45):
pattern_grid
: Supported by most "geometry" patterns. Default is "square" while "hex" and "hex_circle" allow hexagonal layouts.pattern_res
: Supported by "array" patterns. Allow user to explicitly set resolution of image-based patterns.pattern_rot
: Used by "pch", "regular_polygon", "rose", and "text" patterns to rotate symbol within pattern. 'rot' is parameter used ingrid:textGrob()
to indicate rotation andpattern_angle
already used to rotate entire pattern.
geom_polygon_pattern()
andgeom_sf_pattern()
now support polygons with holes (#26, #44). If R 4.1 clipping features are not supported by the graphic device (or the clipping feature is declined) we must use a raster image approximation of the pattern. Resolution of the raster approximation can be adjusted by thepattern_res
aesthetic whose default in turn can be adjusted by the"ggpattern_res"
global option.
{ggpattern} now uses {gridpattern} to generate pattern grobs. This means there are minor tweaks to visual behavior:
- 'pattern_spacing', 'pattern_xoffset', and 'pattern_yoffset' are now interpreted as 'spnc' units instead of 'npc' units. and the center of the pattern "grid" is now the center of the viewport. To exactly restore the original appearance of {ggpattern} "geometry" patterns one may need to tweak the 'pattern_density', 'pattern_spacing', 'pattern_xoffset', and/or 'pattern_yoffset' aesthetics.
- The resolution of "array" patterns should be close
but not identical to before.
In particular placeholder images will likely be different. - Custom {ggpattern} patterns can no longer use the same name as a {ggpattern} / {gridpattern} builtin pattern and an error will be thrown if you try to do so.
The following functions copied from {ggplot2} are no longer exported by {ggpattern}:
alpha()
, instead useggplot2::alpha()
orscales::alpha()
flip_data()
, instead useggplot2::flip_data()
flipped_names()
, instead useggplot2::flipped_names()
gg_dep()
, instead useggplot2::gg_dep()
has_flipped_aes()
, instead useggplot2::has_flipped_aes()
remove_missing()
, instead useggplot2::remove_missing()
should_stop()
, instead useggplot2::should_stop()
waiver()
, instead useggplot2::waiver()
{ggpattern} now deprecates the following data/functions, they may be removed in a future version of {ggpattern}:
calculate_bbox_polygon_df()
convert_img_to_array()
convert_polygon_df_to_alpha_channel()
create_gradient_img()
fetch_placeholder_img()
fill_area_with_img()
magick_filter_names
, instead usemagick::filter_types()
magick_gravity_names
, instead usemagick::gravity_types()
magick_pattern_intensity_names
, instead usegridpattern::names_magick_intensity
magick_pattern_names
, instead usegridpattern::names_magick
magick_pattern_stripe_names
, instead usegridpattern::names_magick_stripe
placeholder_names
, instead usegridpattern::names_placeholder
rotate_polygon_df()
-
{ggpattern} now supports all patterns provided by {gridpattern}. In particular {gridpattern} provides the following "new" patterns:
- "ambient" (the suggested package
{ambient}
must be installed) - "pch"
- "polygon_tiling"
- "regular_polygon"
- "rose"
- "text"
- "wave"
- "weave"
- "ambient" (the suggested package
-
'pattern_fill2' can now be used to set the fill for the vertical lines in the 'crosshatch' pattern.
By default, if unset, it uses 'pattern_fill' (#35). -
'circle' pattern can now be adjusted by 'pattern_type' and 'pattern_subtype'. See
help("grid.pattern_circle", package = "gridpattern")
for more info. -
'gradient' pattern can now use grid gradient feature introduced in R v4.1.0 if
options(ggpattern_use_R4.1_gradients = TRUE)
. -
The following package options can now be set by
options()
:ggpattern_use_R4.1_clipping
IfTRUE
use the grid clipping path feature introduced in R v4.1.0 else do arasterGrob
approximation of the clipped pattern.ggpattern_use_R4.1_features
IfTRUE
sets the default for all the otherggpattern_use_R4.1_*
options arguments toTRUE
.ggpattern_use_R4.1_gradients
IfTRUE
use the grid gradient feature introduced in R v4.1.0 else do arasterGrob
approximation of the gradient pattern.ggpattern_use_R4.1_masks
IfTRUE
use the grid mask feature introduced in R v4.1.0. Available for use in custom patterns.ggpattern_use_R4.1_patterns
IfTRUE
use the grid pattern feature introduced in R v4.1.0. Available for use in custom patterns.
- 'pattern_alpha' default is now
NA
(preserve any alpha transparency inpattern_fill
,pattern_fill2
, andpattern_colour
colors) rather than1
(set them fully opaque). - 'circle' pattern can now be adjusted by 'pattern_xoffset' and 'pattern_yoffset'.
- Support POLYGON in
geom_sf_pattern()
(Issue #5)
- Fix issue with attempts to fill an area with a pattern when it has zero area. (Issue #9)
- Use
magick::image_data()
instead ofmagick::as_EBImage()
for internal conversion of images to arrays inconvert_img_to_array()
- Initial release