1

With this code:

ggMarginal(p1, margins = "x", size = 2, type = "histogram",
       col = "blue", fill = "orange")

I can make this type of plot:

ggMarginal

But I would like to show on the y axis of the histogram the values in percentage scale, could you help me?

M--
  • 25,431
  • 8
  • 61
  • 93
user40267
  • 51
  • 2
  • 5
  • Please read [How to make a great reproducible example in R?](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). Working on some data is much easier than throwing some guesses to answer your question. – M-- Jul 03 '17 at 20:20
  • https://github.com/ChrKoenig/R_marginal_plot – M-- Jul 03 '17 at 20:31

1 Answers1

0

you should import package (scales), should look something like this

...
library('scales')
ggMarginal(p1, margins = "x", size = 2, type = "histogram",
       col = "blue", fill = "orange") + scale_y_continuous(labels=percent)
zdeeb
  • 142
  • 9
  • Thank you but it gave me this error: Error in ggMarginal(p1, margins = "x", size = 2, type = "histogram", col = "blue", : non-numeric argument to binary operator – user40267 Jul 06 '17 at 14:41