geocompx / geocompx/tmap

Scope and limitations of extra.ggplot2

Open
#10 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
32
Forks
9
PR merge metrics
No merged PRs in 30d

Description

@mtennekes -- would you be able to let me know what is the scope and limitations of the extra.ggplot2 argument in the charts functions? For example, I've tried to use the dark theme, and the whole chart is not longer readable. Thus:

  1. What is the scope of this argument?
  2. Is it possible to specify a few ggplot2 options with it?
library(tmap)
library(spData)

tm_shape(nz) +
  tm_polygons("Median_income",
              fill.chart = tm_chart_histogram())


tm_shape(nz) +
  tm_polygons("Median_income",
              fill.chart = tm_chart_histogram(
                extra.ggplot2 = ggplot2::theme_dark()
              ))

Created on 2025-06-24 with reprex v2.1.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the charts functions and the extra.ggplot2 argument shown in the tm_chart_histogram examples. Trace how supplied ggplot2 options are applied, then document the argument's scope, supported options, and the limitation demonstrated by theme_dark().

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.