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

How to change group names color in pirateplot? #56

Open
ghost opened this issue Apr 9, 2022 · 3 comments
Open

How to change group names color in pirateplot? #56

ghost opened this issue Apr 9, 2022 · 3 comments

Comments

@ghost
Copy link

ghost commented Apr 9, 2022

Also, how to change axis colors ? (line , tick, label)

image

@fraupflaume
Copy link

Since this uses base R functionality, you can customize labels by first removing what's there and then adding what you want. I'm removing the x-axis tick labels with xaxt = 'n'. I'm adding the labels with the function axis(), the 1 indicates the first or x-axis.

pirateplot(formula = weight ~ Diet, 
           data = ChickWeight,
           xaxt = 'n')
axis(1, labels = paste0("Diet ", 1:4), at = 1:4)

image

@ghost
Copy link
Author

ghost commented Apr 16, 2022

@fraupflaume and maybe change their colors using col.lab ?
But does col.lab work if it is defined inside axis?

@fraupflaume
Copy link

Sorry about the delayed response, I didn't realize that I had this waiting for me. The color of the labels can change with the parameter col.axis within a plot() or axis() call. For example:

pirateplot(formula = weight ~ Diet, 
           data = ChickWeight,
           xaxt = 'n')
axis(1, labels = paste0("Diet ", 1:4), at = 1:4, col.axis = "#b21e29")

image

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

1 participant