Skip to content

cmapplot 1.1.0

Compare
Choose a tag to compare
@dlcomeaux dlcomeaux released this 02 Mar 17:35
· 241 commits to master since this release
878be4b

This pair of updates primarily makes many changes to finalize_plot() to enable printing plots without the left-hand "sidebar" -- the area that contains the title and the caption. Most but not all changes are under the hood and should not impact the user. Those that will impact the user include:

  • There is a new argument, inherit, that allows the user to specify whether cmapplot should attempt to inherit titles and/or captions from the underlying ggplot object.
  • The argument title_width has been renamed sidebar_width to better reflect its function.
  • Setting sidebar_width = 0 now has the effect of shifting the title above the topline and shifting the caption from the title column to directly below the plot. If the user does not want a title on the vertical layout graphic, this can be achieved by leaving title = "", the default, and (if relevant) specifying that finalize_plot() should not attempt to inherit a title from the underlying ggplot object.
  • There is a new argument, caption_align, which takes numeric range 0 to 1. 0, the default, aligns the caption bottom or left (in title-column and below-plot captions, respectively). 1 aligns the caption top or right. 0.5 centers. The argument caption_valign has been deprecated.
  • The value margin_title_l has been replaced with margin_sidebar_l, which only affects horizontal layout graphics. The margin for titles and captions in the vertical layout is based on margin_plot_l.
  • Separately, this version also creates this NEWS.md file for the pkgdown website.

Under-the-hood changes to finalize_plot() are documented in PR #111, specifically here.

Backward compatibility notes

Users who have written code with previous versions of cmapplot should note these known compatibility issues:

  • In finalize_plot(), the argument caption_valign has been deprecated and will now issue a message alert (but will still work, for now). Please update your code to use the new argument caption_align.
  • In finalize_plot(), the argument title_width has been deprecated and will now issue a message alert (but will still work, for now). Please update your code to use the new argument sidebar_width.
  • Any overrides using the deprecated value margin_title_l will no longer have any affect. Use margin_sidebar_l instead.