r
  • plot
  • line
  • 2017-01-27 101 views -1 likes 
    -1

    下面的代碼給我一個折線圖,但只顯示了Th1,Th2和Th17的行。其他3個值的數字顯着較低(最大值約爲30),但它們仍應作爲線條顯示。我需要在我的代碼中輸入什麼來修復它?繪製多行

    line graph

    { 
        plot(type="l", termCountTh1, col="green", xaxt = "n", xlab='date', ylab='mentions', 
        main='The amount of articles mentioning when searching CD4+') 
        axis(1, at=1:5, labels=2012:2016) 
        lines(termCountTh9, col="deepskyblue4") 
        lines(termCountTFH, col="deeppink3") 
        lines(termCountiTreg, col="darkred") 
        lines(termCountTh17, col="blue") 
        lines(termCountTh2, col="purple") 
    } 
    
    +1

    請格式化你的代碼,以便其他人可以閱讀。 http://meta.stackoverflow.com/questions/251361/how-do-i-format-my-code-blocks – akousmata

    回答

    0

    嘗試在plot()設置ylim=c(ymin, ymax))。在添加lines()的行時,軸範圍不會更新。它們是指提供給初始繪圖的值。

    看看這裏的例子:http://www.statmethods.net/advgraphs/axes.html

    相關問題