grantmcdermott / grantmcdermott/tinyplot

Easy way to reverse palette?

Open
#299 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
427
Forks
25
Avg merge
22h 54m
Merged PRs (30d)
28

Description

I might be missing an obvious workaround, but I've encountered a few situations where I'd like an easy way to reverse the colour palette. For example, the colours of the "temps" HCL palette are running in the "wrong" direction here:

library(tinyplot)

plt(Month ~ Temp, airquality, type = type_ridge(gradient = "temps"))

Created on 2025-02-03 with reprex v2.1.1

Contributor guide

No contributing guide indexed for this repository

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 by reproducing the supplied airquality example with tinyplot, plt(), and type_ridge(gradient = "temps"), then trace how the gradient palette is selected. Done means users have an easy way to reverse the palette direction and the example produces the intended colour ordering.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.