yarrr
yarrr copied to clipboard
How to change group names color in pirateplot?
Also, how to change axis colors ? (line , tick, label)
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)
@fraupflaume and maybe change their colors using col.lab
?
But does col.lab
work if it is defined inside axis?
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")