scales icon indicating copy to clipboard operation
scales copied to clipboard

Add `style_positive` and `style_negative` to other continuous labelers

Open bwiernik opened this issue 2 years ago • 4 comments

I most often work with numbers that are changes in percentages (e.g., -2%, +5%). I mostly use label_percent() for this. However, I'd like to be able to use the style_positive and style_negative arguments from label_number() to format with proper plus and minus signs. Would it be possible to add these arguments to other continuous labelers (especially label_percent())?

bwiernik avatar Jul 06 '22 20:07 bwiernik

library(scales)

demo_continuous(c(-50,50), labels = label_percent(scale = 1, style_positive = "plus", style_negative = "minus") )

hope this help

factorialmap avatar Aug 19 '22 02:08 factorialmap

Ah, so the issue is just that they aren't documented

bwiernik avatar Aug 19 '22 11:08 bwiernik

@bwiernik i've proposed a revision that addresses this, by changing where ... points to (namely, label_numeric, which includes the style_(positive|negative) documentation). is that a sufficient change?

pearsonca avatar Aug 30 '22 10:08 pearsonca

That should work

bwiernik avatar Aug 30 '22 10:08 bwiernik