Skip to content

ggpattern v0.4.2

Compare
Choose a tag to compare
@trevorld trevorld released this 22 Feb 21:27
· 47 commits to master since this release

Breaking changes

  • 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 of options(ggpattern_use_R4.1_clipping = FALSE).
    Alternatively, using options(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.

New features

  • {ggpattern} now supports geom_histogram_pattern() (#71)

Bug fixes and minor improvements

  • geom_sf_pattern() and geom_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 the pattern_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, and
    GeomSfPattern 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 underlying ggplot2::continuous_scale() call.

  • We now export scale_pattern_alpha() which is an alias of
    scale_pattern_alpha_continuous().