Skip to content
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

using ggplot2 commands to format x and y axis #38

Closed
bharuch2 opened this issue Feb 5, 2023 · 2 comments
Closed

using ggplot2 commands to format x and y axis #38

bharuch2 opened this issue Feb 5, 2023 · 2 comments

Comments

@bharuch2
Copy link

bharuch2 commented Feb 5, 2023

Love the qichart2 package. Thank you for all your work.

I'm recent working on "p" chart over a series of years.
years are "double".
when I graph the qic chart, the x-axis shows decimals (e.g. 2015.2).

I was hoping to use ggplot2 package commands (https://scales.r-lib.org/index.html), or scale_x_continuous(label = scales::label_comma(accuracy = 1) (https://stackoverflow.com/questions/15622001/how-to-display-only-integer-values-on-an-axis-using-ggplot2)
but I'm having figure out syntax for the qic() function to also respect ggplot.
-I thought it might be possible since per the documentation, I saw that qic() was based on ggplot.

Thank you.

@anhoej
Copy link
Owner

anhoej commented Feb 5, 2023

Hi bharuch2

Thank you for your interest in qicharts2. Could you please provide a minimal reproducible example including data and code together with an example of the desired output.

PS: have you tried making dates date or POSIX type rather than double?

@bharuch2
Copy link
Author

thank you so much for your willingness. My google skills are better (or may lucky).

based on this, and above...

I solved it by following

y <- qic (....)

y +
scale_x_continuous(label = scales::label_number(accuracy = 1, big.mark = ""))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants