How to merge colour and shape?

前端 未结 3 1829
我寻月下人不归
我寻月下人不归 2021-02-01 23:38

My troubles started when I had a variable with more than 6 values because that is the current maximum value for the scale_shape function in ggplot2.

Due to that problem

3条回答
  •  感动是毒
    2021-02-02 00:26

    What about using scale_shape_manual()? If I understood your question correctly, you don't really need to differentiate by both colour and shape and would prefer shape, right?

    ggplot(dataf, aes(x=Density, y=Growth)) + 
      geom_point(aes(shape = Municipality)) +
      scale_shape_manual(values = 1:11)
    

    produces: enter image description here

提交回复
热议问题