Re: [問題] 折線圖+長條圖呈現

看板R_Language作者 (<(◥█◤△◥█◤)>)時間9年前 (2016/11/23 01:33), 9年前編輯推噓7(702)
留言9則, 5人參與, 最新討論串5/9 (看更多)
想看別種繪圖嗎? plotly: 我這不是來了嗎? 借用celestialgod的data frame作範例 library(plotly) dt <- data.frame( x = 1:8, freq = c(120,130,140,150,160,170,170,180), earn = c(3,3,5,4,6,7,3,5) * 0.1 ) dt_earn_plotly <- plot_ly(data = dt, x=dt$x, y=dt$earn, type = "scatter", mode = "liners", name = "earn") dt_freq_plotly <- plot_ly(data = dt, x=dt$x, y=dt$freq, type = "bar", name = "freq") dt_plotly <- subplot(dt_earn_plotly, dt_freq_plotly, nrows = 2, shareX = TRUE) dt_plotly 圖: http://yichunsung.github.io/plotly.png
互動介面: http://yichunsung.github.io/plotly Code可能在Github上你會看得比較清楚: https://github.com/yichunsung/R_Application/blob/master/plotly%20sample.R -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.34.121.188 ※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1479835999.A.338.html

11/23 01:39, , 1F
哈哈哈,推,真的有人刻了
11/23 01:39, 1F

11/23 01:40, , 2F
偷偷說偷懶的方法其實是直接把ggplot的圖,加上ggpl
11/23 01:40, 2F

11/23 01:40, , 3F
otly就好
11/23 01:40, 3F

11/23 09:54, , 4F
出現第四個套件啦XDD 真的好多畫法啊
11/23 09:54, 4F

11/23 11:09, , 5F
plotly比較fancy,而且用ggplot的語法就能實現
11/23 11:09, 5F

11/23 11:09, , 6F
端看個人喜好XDD,漂亮的大家都愛阿
11/23 11:09, 6F

11/23 19:14, , 7F
現在是在集七龍珠嗎?
11/23 19:14, 7F

11/23 23:02, , 8F
可以藉機請教cd12631大大怎麼把圖放到github.io上的嗎?
11/23 23:02, 8F
如果是問那個互動網頁介面的話 可以參考 https://pages.github.com 或google github pages 我就是利用plotly 做一個網頁 然後丟到自己github裡 github.io的repository裡 ※ 編輯: cd12631 (114.34.121.188), 11/24/2016 00:32:47

11/24 00:50, , 9F
謝謝cd大!! 我試成功了,感謝!
11/24 00:50, 9F
文章代碼(AID): #1OD85VCu (R_Language)
文章代碼(AID): #1OD85VCu (R_Language)