{"id":1488,"date":"2023-08-28T23:33:56","date_gmt":"2023-08-28T15:33:56","guid":{"rendered":"https:\/\/stu.chcmu.asia\/?p=1488"},"modified":"2024-05-22T15:43:02","modified_gmt":"2024-05-22T07:43:02","slug":"nightingale-rose-chart","status":"publish","type":"post","link":"https:\/\/stu.chcmu.asia\/index.php\/2023\/08\/28\/nightingale-rose-chart\/","title":{"rendered":"Nightingale Rose Chart"},"content":{"rendered":"<pre><code class=\"language-r\"># \u521b\u5efa\u6570\u636e\nmydata &lt;- data.frame(var =c(&quot;hsa&quot;,&quot;mmu&quot;,&quot;rat&quot;,&#039;cat&#039;,&quot;dog&quot;,&quot;pig&quot;,&#039;rabbit&#039;,&#039;monkey&#039;),\n                     value = c(8,10,6,5,3,4,4,2) )\nmydata &lt;- mydata[order(mydata$value),]\nmydata$var &lt;- factor(mydata$var,levels = mydata$var )\n\nlibrary(ggplot2)\nggplot(mydata,aes(x=var,y=value,fill= value ))+\n  geom_bar(width=1,\n           stat = &quot;identity&quot;,\n           colour=&quot;white&quot; ) +\n  scale_fill_gradient(low = &quot;pink&quot;, high = &quot;red4&quot;)+\n  # \u6570\u503c\u6807\u7b7e\u3001\u989c\u8272\u3001\u5b57\u53f7\n  geom_text(aes(y=value, label=value),\n            color=&quot;gray50&quot;,size=10) +\n\n  coord_polar(theta = &quot;x&quot;,start=0) +\n  theme_bw()+ # \u4e3b\u9898\n  theme(axis.text.x  = element_text( size=20, colour=&quot;black&quot;, angle= 0 ),\n        axis.title = element_text(size = 25),\n        axis.title.y = element_text(size = 25, angle = 90, vjust = 0.5),\n        axis.ticks.y = element_blank(),\n        axis.text.y  = element_blank(),\n        panel.border = element_blank()\n        )<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p># \u521b\u5efa\u6570\u636e mydata &lt;- data.frame(var =c(&quot;hsa&quot;,&#038; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1490,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,31],"tags":[],"class_list":["post-1488","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r","category-statistics"],"_links":{"self":[{"href":"https:\/\/stu.chcmu.asia\/index.php\/wp-json\/wp\/v2\/posts\/1488","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stu.chcmu.asia\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stu.chcmu.asia\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stu.chcmu.asia\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/stu.chcmu.asia\/index.php\/wp-json\/wp\/v2\/comments?post=1488"}],"version-history":[{"count":3,"href":"https:\/\/stu.chcmu.asia\/index.php\/wp-json\/wp\/v2\/posts\/1488\/revisions"}],"predecessor-version":[{"id":1492,"href":"https:\/\/stu.chcmu.asia\/index.php\/wp-json\/wp\/v2\/posts\/1488\/revisions\/1492"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/stu.chcmu.asia\/index.php\/wp-json\/wp\/v2\/media\/1490"}],"wp:attachment":[{"href":"https:\/\/stu.chcmu.asia\/index.php\/wp-json\/wp\/v2\/media?parent=1488"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stu.chcmu.asia\/index.php\/wp-json\/wp\/v2\/categories?post=1488"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stu.chcmu.asia\/index.php\/wp-json\/wp\/v2\/tags?post=1488"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}