Repository navigation
-
Fix
palette_pander()returning a color forn = 0; it now returns
character(0). -
The README is reorganized: an overview of what the package provides, a
two-column theme gallery linked to the reference pages, a geoms section and
current installation instructions. The full color palette gallery moves to
a new "Color palettes" article on the package website, drawn as images; the
README's HTML swatches rendered as empty cells on GitHub, which strips their
colors. -
Fix
theme_foundation()on ggplot2 >= 4.0.0. It is meant to clear every
colour and fill inherited fromtheme_grey(), but ggplot2 4.0.0's S7 theme
elements hid them from the check, sotheme_grey()'s grey panel, grey strips
and white grid lines leaked into every theme built on it. On ggplot2 4.x this
changes the appearance oftheme_base(),theme_calc(),theme_clean(),
theme_fivethirtyeight(),theme_foundation(),theme_gdocs(),
theme_numbers(),theme_solarized_2(),theme_solid(),theme_stata()
andtheme_wsj()back to their intended look, which ggplot2 3.5.x users
already saw. In particular,theme_solid(fill = )now fills the panel
rather than only the area around it. -
Expand the README theme gallery to cover every non-deprecated exported
theme, pairing each with its matching palette where available. -
theme_map()places its legend withlegend.position = "inside"and
legend.position.inside, instead of the numericlegend.position
deprecated in ggplot2 3.5.0. The legend is drawn in the same place. -
geom_tufteboxplot()gains alinewidthaesthetic for its lines, as in
ggplot2::geom_pointrange();sizenow sets only point sizes. This removes
the ggplot2 deprecation warnings it emitted on every plot. Settingsize
withoutlinewidthstill widens the lines too, so existing code draws the
same, and plots drawn with the defaults are unchanged. -
stat_fivenumber()declares the aesthetics it drops, so it no longer
warns thatywas dropped during the statistical transformation. -
Fix
solarized_pal()storing the palette function instead of the palette
size in itsmax_nattribute. Requesting more than eight colours now pads
withNAafter the usual warning instead of failing with "subscript out of
bounds", andn = 0returnscharacter(0). -
Fix
few_pal()returning two colours forn = 0; it now returns
character(0). -
Require ggplot2 >= 3.5.2.
bank_plot()andbank_plot_multiscale()
already calledggplot2::is_ggplot(), so older versions failed at run time. -
Correct the documented values of
typeinscale_colour_tableau()and
scale_fill_tableau(): they are"regular","ordered-sequential"and
"ordered-diverging", not"sequential"and"diverging". -
BREAKING CHANGE:
theme_excel_new()now matches the chart chrome Excel
actually draws, decoded from the chart XML that Excel writes. Major
gridlines are#D9D9D9rather than#BFBFBF; axis lines are drawn in
#BFBFBF, where previously there were none; and axis titles are one point
larger than axis labels, as in Excel. Existing plots will change appearance. -
theme_excel_new()documents that Excel's font has been Aptos since 2023.
base_familystill defaults to"sans", since Aptos is rarely installed
outside Office; passbase_family = "Aptos Narrow"for a closer match. -
Add the current Microsoft Office theme, which Microsoft made the default in
2023, as the"Office"Excel theme:
#156082,#E97132,#196B24,#0F9ED5,#A02B93,#4EA72E.
ggthemes_data$excel$themesnow has 51 themes. -
BREAKING CHANGE:
excel_new_pal(),scale_colour_excel_new()and
scale_fill_excel_new()now default totheme = "Office"instead of
"Office Theme", so they again match a default chart in current Excel.
Plots that relied on the default will change appearance. Pass
theme = "Office 2013"to keep the previous colours. -
The Excel themes
"Office Theme"and"Office 2007-2010"have been renamed
"Office 2013"and"Office 2007", following Microsoft's own renaming of
the built-in themes. The old names still work and select the same colours as
before. -
Add
bank_slopes_multiscale()andbank_plot_multiscale(), implementing
multi-scale banking to 45 degrees (Heer and Agrawala 2006, section 3).
Single-scale banking considers all of the data at once, so it accentuates
local features and can obscure larger-scale trends. Multi-scale banking uses
spectral analysis to identify the frequency scales that carry real energy,
low-pass filters the data to each scale, and banks the resulting trend
curve, returning one aspect ratio per scale.
bank_slopes_multiscale()returns a tibble of frequencies and ratios;
bank_plot_multiscale()returns oneggplotper scale, reproducing the
small-multiples display used in the paper. Onsunspot.yearthe
implementation selects the same frequency scales the paper reports. -
stata_shape_pal()now fails with a message naming the offending
symbolstyles when Stata's shape data does not contain the ten the palette
selects. It previously looked them up with a barematch(), so a renamed or
missingsymbolstyleproduced an all-NArow that was silently dropped as
"no font-independent equivalent", leavingmax_nquietly below the
documented ten. The list of ten now lives in one place anddata-raw/build.R
sources it, so the build's duplicate-pch check cannot run over a stale copy. -
BREAKING CHANGE:
stata_shape_pal(),calc_shape_pal(),
tableau_shape_pal()andcleveland_shape_pal()now return base pch codes
by default instead of pch codes derived from Unicode glyphs. R draws a
negative pch by asking the device font for that codepoint, so these palettes
rendered as blank boxes in a font without coverage — R's defaultsans
covers one of the eight codepoints they relied on — and aborted outright on
basepdf()/postscript(). Passunicode = TRUEto restore the previous
values.scale_shape_stata(),scale_shape_calc(),scale_shape_tableau()
andscale_shape_cleveland()gain the same argument. -
BREAKING CHANGE:
max_nis reduced on the default branch for the palettes
whose source symbols have no font-independent equivalent:calc13 to 7,
tableau_shape_pal("filled")10 to 6,tableau_shape_pal("default")10 to
8,cleveland_shape_pal(overlap = FALSE)5 to 3 and
tableau_shape_pal("proportions")5 to 2. Those shapes are dropped rather
than approximated by a different shape.stata_shape_pal()and
few_shape_pal()are unaffected — their symbol sets map exactly. -
BREAKING CHANGE: the
pchcolumn of the shape tables inggthemes_datanow
holds the font-independent base pch,NAwhere there is none. The previous
Unicode-derived values move to a newpch_unicodecolumn, and a newshape
column carries the canonical shape name both are derived from. -
BREAKING CHANGE:
tremmel_shape_pal()returned symbol sets that did not
match Tremmel (1995).n = 2now returns a solid circle and a plus sign (was
two circles),overlap = TRUEreturns an empty circle and a plus sign (was a
square and a plus sign), andalt = TRUEreturns a solid circle, plus sign
and empty triangle (was identical toalt = FALSE, making the argument a
no-op). -
Fix
scale_shape_tremmel()defaulting toalt = TRUEwhile
tremmel_shape_pal()defaulted toalt = FALSE, so a palette and its own
scale disagreed atn = 3. Both now default toFALSE, the variant
Tremmel's Experiment 1 measured. -
Fix
cleveland_shape_pal(overlap = TRUE)drawing aWwhere anSwas
intended; the stored row paired the nameLATIN CAPITAL LETTER Swith
pch 87. -
Fix mislabelled and corrupted shape data: LibreOffice's
BLACK DOWN-POINTING CHARACTER(nowTRIANGLE), Google Docs' star named
MULTIPLICATION X, Excel's em dash declared asU+2013, and Tableau's
CLOUD WITH RAIN, stored as a mojibake sequence rather thanU+1F327. -
The shape tables are now validated as they are built: a shape name outside
the vocabulary, acharacterthat disagrees with its ownunicode, or two
shapes in one palette sharing a pch all fail the build, and the same checks
run as tests against the built data. -
warn_unicode_pch()'s locale guess is joined by a real font-coverage check
usingsystemfonts::glyph_info()whensystemfontsis installed, naming the
glyphs the device font cannot draw.systemfontsis used inSuggests. The
locale and coverage checks are independent failure modes and both run: a
UTF-8 session can still meet a font with no glyph, and a font with full
coverage still fails withmbcsToSbcson a non-UTF-8 session. Note that R
exposes no way to read back a device'sfamily=, so the probe measures the
default font and the warning names the font it actually measured. -
Discrete colour palettes now reject a negative
nwith an error naming the
argument and the palette that was called. Palettes built on
scales::manual_pal()--- includingcalc_pal(),canva_pal(),
colorblind_pal(),excel_pal(),excel_new_pal(),
fivethirtyeight_pal(),gdocs_pal(),hc_pal(),stata_pal()and
wsj_pal()--- previously failed with R's internal
argument must be coercible to non-negative integerfromseq_len().
This raises the minimum version of scales to 1.4.0, which is where
scales::new_discrete_palette()was introduced. -
bank_slopes()andbank_plot()report an invalidmethod, and
tableau_shape_pal()an invalidpalette, with a message naming the
argument and the value supplied instead ofmatch.arg()'s
'arg' should be one of .... Misspellings now get a "Did you mean" hint. -
Deprecate
ptol_pal(),scale_colour_ptol(),scale_color_ptol()and
scale_fill_ptol(). Use the
khroma package instead, which
tracks Paul Tol's colour schemes as he revises them. The ggthemes palette is
the original 12-colour qualitative scheme from Tol's 2012 technical note and
has not followed the revisions on his current site,
https://sronpersonalpages.nl/~pault/; the closest successor is
khroma::colour("muted"). The functions still work, but warn. -
BREAKING CHANGE: The Tableau palette
"Red-Blue-Brown"has been renamed to
"Blue-Red-Brown", matching both the name Tableau uses and the palette's
actual colour order (blue, red, brown). The old name still works but warns. -
BREAKING CHANGE: The Tableau palette
"Classic Area-Brown"has been renamed
to"Classic Area Brown", for consistency with its siblings
"Classic Area Red"and"Classic Area Green". The old name still works but
warns. -
Fix two corrupted colours in the
"Gray Warm"ordered-sequential Tableau
palette. Position 7 was#b047a4(a magenta, in a warm-grey ramp) and is now
#b0a8a4; position 18 was#665c51, which broke the ramp's monotonic blue
channel, and is now#665c5a. Plots using
scale_colour_gradient_tableau("Gray Warm")will change appearance. -
Fix a duplicated colour (
#fa9d4f) in the"Red-Gold"ordered-sequential
Tableau palette, which gave it 21 colours where every other 20-step Tableau
sequential palette has 20. Plots using"Red-Gold"will change appearance. -
Remove
data-raw/theme-data/tableau-new.yml, an unused duplicate of
tableau.yml. -
The test suite no longer requires suggested packages to be installed.
expect_hexcolor()used stringr and glue on every palette test,
and stringr had moved fromImportstoSuggests; it now uses base
equivalents. The tests that genuinely need withr or farver skip
when those are absent instead of erroring. -
geom_rangeframe()now errors on asidesvalue that names no side, rather
than silently drawing nothing.sidespacks side letters into one string, so
a typo such assides = "xy"previously produced an empty layer with no
message. Valid values are strings made up of"t","r","b"and"l". -
Fix the
?extended_range_breakshelp page, which described a function
scales_extended_range_breaks()that does not exist and attributed the
wrong return value to each function.extended_range_breaks_()returns the
break values;extended_range_breaks()returns a breaks function. The page
now also warns that ggplot2 passes abreaksfunction the expanded scale
limits, sobreaks = extended_range_breaks()labels the panel edges rather
than the data extremes; apply the function to the data to label the extremes. -
Fix
theme_economist_white()failing on installations without dplyr.
The internalget_colors()helper calleddplyr::filter(), but dplyr is a
suggested package, not an import; it now uses base subsetting. The test
suite no longer uses dplyr either, soR CMD checkpasses with only the
hard dependencies installed. -
Fix the
@familytags that split related help pages apart. Word-order and
singular/plural inconsistencies (stata colour,solarized colour,
shape stata,shape tableau) each put one page in a family of its own, so
it linked to nothing.?extended_range_breakshad no family at all and was
unreachable fromtheme_tufte(),geom_rangeframe()and
geom_tufteboxplot(), which it is meant to be used with; those four now
cross-reference each other. -
Add vdiffr visual regression baselines for every exported theme, and swatch
baselines plus property assertions (valid hex, no duplicate colours, stable
lengths, monotone lightness, no out-of-family colour, monotone grey ramps)
for the Tableau palette families. These are development-only tests and do not
run on CRAN;vdiffr (>= 1.0.6)andfarverare now used inSuggests
(#219). -
Add support for Stata's
stscheme family, which has been Stata's factory
default since Stata 18.stata_pal()andscale_colour_stata()gain the
"stcolor"scheme (thestc1--stc15colours), andtheme_stata()gains
the"stcolor","stcolor_alt","stmono1","stmono2"and"stsj"
schemes.stgcolorandstgcolor_altare not included: they differ from
stcoloronly in physical graph dimensions, which a ggplot2 theme does not
carry. -
The 19 named colours Stata 18 added (
stc1--stc15plus thestblue,
stred,stgreenandstyellowaliases) are now in
ggthemes_data$stata$colors$names. -
Omitting
schemeinstata_pal(),scale_colour_stata(),
scale_fill_stata()andtheme_stata()is now soft-deprecated. It still
resolves to"s2color", but the default will change to"stcolor"in
ggthemes 8.0.0, following Stata. Passschemeexplicitly to keep the
current appearance. -
BEHAVIOUR CHANGE:
stata_pal("mono")returned the wrong colours at
positions 6 and 12 (gs14andgs15instead ofgs12andgs5). It now
matches Stata'ss1mono/s2monoexactly, including the fact that Stata
repeatsgs12andgs5at positions 14 and 15. Plots using"mono"with
six or more levels will change. -
Fix
stata_pal("economist"), which returnedNAas its first colour
because the scheme referred to a non-existent colourdkblue. It is now
edkblue, matching Stata'sscheme-economist.scheme. -
Fix
attr(stata_pal(scheme), "max_n"), which reported2rather than15
because it measured the columns of the palette table instead of its rows. -
Add Apple Numbers support:
numbers_pal(),scale_colour_numbers(),
scale_color_numbers(),scale_fill_numbers(), andtheme_numbers().
All 12 Numbers chart palettes are available by their Numbers names
("Classic", the default, through"Spectrum"), each providing six
series colors.theme_numbers()follows the chart style defaults that
ship inside Numbers: no panel fill, gridlines in the value direction
only, a bottom chart border, and no tick marks. -
The palettes are generated from Apple Numbers 14.5 by
data-raw/reference/numbers/fetch.shanddata-raw/numbers_palettes.R;
seedata-raw/reference/numbers/SOURCES.md. This replaces
data-raw/theme-data/numbers-charts.yml, an unused file added in 2018
that was never wired intodata-raw/build.Rand held iWork-era colors
matching no current Numbers palette. -
Fix two incorrect colours in the Google Docs palette, checked against the
series colours a current Google Sheets chart actually renders.teal 2was
#ff994d, a duplicate oforange 2, and is now#7ed1d7;teal 3was
#c9e4e7and is now#b5e5e8. This changes the output ofgdocs_pal(),
scale_colour_gdocs(), andscale_fill_gdocs()for more than 11 colours.
The other 22 colours were already correct. -
theme_gdocs()now matches the text colours Google Sheets uses. Sheets
applies a graded hierarchy rather than one grey: axis tick labels are black,
legend labels#1a1a1a, and axis titles and the x-axis line#333333. The
chart title (#757575) and gridlines (#cccccc) are unchanged. -
BREAKING CHANGE:
hc_pal("default")now returns the palette Highcharts has
used by default since v11.0.0 (#2caffe,#544fc5,#00e272, ...). It
previously returned the palette used before v11 (#7cb5ec,#434348, ...),
which Highcharts replaced in April 2023. Plots usingscale_colour_hc()or
scale_fill_hc()without an explicitpalettewill change appearance. The
old palette is still available ashc_pal("classic"). -
BEHAVIOUR CHANGE: two colours in that older palette were wrong, and are
corrected in"classic". Position 8 was#8085e8(a near-duplicate of
#8085e9at position 5, differing by one hex digit) and is now#2b908f;
position 9 was#8d4653and is now#f45b5b. The old values match
Highcharts 4.x; every Highcharts release from v5.0.0 to v10.x shipped the
corrected pair. -
hc_pal()andscale_colour_hc()/scale_fill_hc()gain the palettes
bundled with Highcharts 13:"default_dark"(the dark-mode form of the
default, which Highcharts selects via CSSlight-dark()),
"high_contrast_light"and"high_contrast_dark"(Highcharts' own palette,
tested for colour blindness and tailored to 3:1 contrast),"grid_light",
"sand_signika","avocado"and"sunset". Note that"avocado"and
"sunset"have only four colours. -
hc_pal()now reports amax_nattribute and warns when asked for more
colours than the palette holds, matching the other ggthemes palettes. -
theme_hc()'s horizontal grid lines are now#e6e6e6, matching Highcharts'
--highcharts-neutral-color-10, rather than#D8D8D8. -
theme_hc()gains the"default_dark","grid_light"and"sand_signika"
styles."grid_light"is the one Highcharts theme that draws vertical grid
lines. The"high_contrast","avocado"and"sunset"themes are not
included as styles: upstream they change nothing but the series colours, so
they are available throughhc_pal()and are meant to be combined with
theme_hc("default")ortheme_hc("default_dark"). -
BEHAVIOUR CHANGE:
theme_hc("darkunica")drew all text in#A0A0A3and
titles in#FFFFFF. Highcharts uses#E0E0E3for axis labels, titles and
axis titles in this theme, so text is now#E0E0E3throughout. The grid
colour#707073was already correct and is unchanged. -
Fix unreadable axis labels in
theme_hc("darkunica").theme_hc()is a
partial theme, and it never setaxis.text, so the axis labels kept
theme_grey()'s"grey30"and were drawn in dark grey on the near-black
background. They now use the same colour as the rest of the theme's text. -
Remove
data-raw/theme-data/highcharts.yml, an unused duplicate ofhc.yml
that still held the palettes from before v11. -
theme_hc()'s examples now passstylerather than the deprecated
bgcolor, and the last example usesscale_colour_hc()instead of
scale_fill_hc(), which had no effect on its colour-mapped lines. -
BREAKING CHANGE:
theme_economist()andeconomist_pal()now follow the
chart design The Economist introduced in 2017 and still publishes,
replacing the pre-2017 style ggthemes had shipped since 2013. Existing
plots will change appearance. The new look draws a white panel on a pale
#e9edf0ground with light horizontal gridlines, a black x-axis baseline
with tick marks below it (they previously pointed inward), and no y-axis
rule or ticks.economist_pal()returns the nine current chart colors
(#006ba2,#3ebcd2,#379a8b,#ebb434,#b4ba39,#9a607f,
#d1b07c,#758d99,#db444b) in place of the old blues and greens.
Colors and geometry are transcribed from The Economist visual
styleguide v1.2 (4 May 2017); seedata-raw/reference/economist/. -
ggthemes_data$economistis restructured to match:main(the nine
series colors plus "Econ red"),scales(the styleguide's
"equal lightness colour scales", six ordered steps for each of the nine
hues),bg, andtext. The formerfgandbgentries are gone; their
values are recorded in a comment indata-raw/theme-data/economist.yml. -
Add
economist_seq_pal()andeconomist_gradient_pal(), plus
scale_colour_economist_c()/scale_fill_economist_c()for continuous
data andscale_colour_economist_ordinal()/scale_fill_economist_ordinal()
for ordered factors, built from the equal-lightness scales. -
Deprecate
theme_economist_white()(lifecycle::deprecate_warn()); the
current design already draws a white panel, so it no longer differs from
theme_economist(), to which it now forwards. -
Deprecate the
dkpanelargument oftheme_economist()and thefill
argument ofeconomist_pal(). Both were features of the pre-2017 design
and are now ignored. -
Fix:
theme_economist()previously looked up a background colour named
"ebg", whicheconomist.ymldid not define, sorectand
strip.backgroundsilently received a fill ofNA. The rewritten theme
sets both explicitly.