TidierOrg / TidierPlots.jl

Tidier data visualization in Julia, modeled after the ggplot2 R package.
MIT License
196 stars 7 forks source link

Helper functions for labels option in scale #69

Closed rdboyes closed 2 months ago

rdboyes commented 3 months ago

The labels option in scale_x|y_continuous accepts formatting strings via https://github.com/JuliaString/Format.jl, but this isn't exactly how ggplot works. Typically, ggplot syntax would look something like:

g + scale_x_continuous(labels = label_percent) # label_percent is from the scales package

Implementation of these helper functions from scales should be straightforward as they just need to return the appropriate formatting string or (if the string isn't enough) return a function to be used for formatting. Recommend that these functions should go in their own julia file (label_functions.jl or similar). Scales has the following: