在ggplot2中,我們可以選擇按名稱或十六進制代碼設置顏色。有沒有辦法以相同的方式使用rgb值?我搜索了文檔,但快速回答似乎是'不'。 (我想使用rgb的原因是我有一些顏色,我將用於一些情節,我有他們所有的RGB格式。我可以從像here這樣的地方得到十六進制,但它會很好,如果我可以只輸入值直入ggplot()
rgb()with ggplot2 in R
6
A
回答
8
您可以使用函數RGB到分數RGB值轉換爲十六進制
rgb(0.1,0.2,0.3)
[1] "#1A334D"
+3
太好了,我用這個目錄ectly在plot函數中,但是如果你沒有你的RGB顏色的分數,它需要'maxColorValue'參數:'scale_colour_manual(values = c(rgb(207,31,46,maxColorValue = 255)),「#ffda85 「))' – RobertMc
相關問題
- 1. grid.arrange with filled.contour in R Studio
- 2. ggplot2:geom_text()with facet_grid()?
- 3. ggplot2 coord_flip()with geom_text
- 4. RGB to VIBGYOR in python
- 5. 的R - GGPLOT2:coord_radar不
- 6. 」with「macro in C
- 7. Upsert with $ in
- 8. WITH&UNNEST in BigQuery
- 9. Cartogram + choropleth map in R
- 10. R:在GGPLOT2
- 11. [R GGPLOT2聚集
- 12. mysql select with multiple「in」
- 13. PayPal with Braintree Drop-In
- 14. Scala XML with&in CDATA
- 15. HttpWebRequest with https in C#
- 16. SQL SELECT IN with like
- 17. pushViewController with tableViewController in viewController
- 18. Javascript:Window.Open with#sign in URL?
- 19. select2 with acts_as_taggable_on in Rails
- 20. sed with&in變量
- 21. Weirdness with Javascript in date
- 22. Netbeans:JCombobox in Jframe with subindex
- 23. connection.select_all vs select with with rails in rails 3
- 24. Custom Cell with protocol to check in changes in UISwitch
- 25. Cohen's d in R with negative pre to post mean change
- 26. 如何R中GGPLOT2
- 27. R Newb ggplot2問題
- 28. Exuberant Ctags with R
- 29. 動畫Drawable with Sound in android?
- 30. Atom snippet with variable in prefix
什麼功能['rgb'(HTTPS://統計。 ethz.ch/R-manual/R-devel/library/grDevices/html/rgb.html)? – bouncyball
'qplot(x = 1,fill = I(rgb(0.1,0.8,0.5)))' – Axeman
好!不知道這個功能,謝謝,Axeman&bouncyball。 – RobertMc