ggplot with categorical variables with two y axis

Dear all,

I would like to create a plot with categorical variables with two y axis.

I have already created the plot with one y axis. But I am not sure how to add the 2nd y axis in case of categorical variables in the x axis:

df %>%
ggplot(aes(Sample, Weight, color=Type,group=Type)) +
geom_point(alpha=10, size=.5) +
geom_smooth() +
ylab('Weight')

The second y axis could be the Height, which again has the same group: Type.

Can anyone help me?

Thanks so much!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.