-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Function to make top horizontal gridline always above the highest datapoint #8
Comments
scale defaults cannot be updated in the same way we do for geom defaults. It requires a lengthy wrapper function that checks what kind of scale is present and replaces it with the "pretty" version of that scale. Maybe instead of automating this, we can point to and provide guidance on using the existing scales package? |
@fingertipsy |
Or perhaps we could submit a feature request on the ggplot2 repo? |
yes, we could have a function that does something like: limits_pretty <- function(x, ...) range(pretty(x, ...)) ggplot(data, mapping, ...) + I could not find a way to pass this down as a default via the existing theme_af() or use_afcharts(). So the only options I could think of were:
Neither seemed like a great idea. 1.) is basically a small subset of what you can do using the scales package. You have to write the extra line of code to set the axis either way. Not sure, it would add much for users to have a function afcharts::pretty_y_axis()? Happy to discuss at the next meeting |
Thanks. I agree, I don't think this is something we should add to the package. Could you update the cookbook please with an example of how the user can use the following to fix the problem?
I'll create an issue on the ggplot2 package and see if this is an issue that could be added. |
I think having the top horizontal gridline above the highest data point can make the data easier to read. I'm not sure if this is documented in the AF charts guidance though. Gridlines are easy to set manually when you know what the data values are, but are difficult to automate.
The text was updated successfully, but these errors were encountered: