ggplot2で論文用の白黒折れ線グラフ

差分

この文書の現在のバージョンと選択したバージョンの差分を表示します。

この比較画面にリンクする

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
ggplot2で論文用の白黒折れ線グラフ [2018/08/12]
adash333 [エラーバーを片方だけにつける]
ggplot2で論文用の白黒折れ線グラフ [2018/10/07] (現在)
ライン 4: ライン 4:
  
 基本的には、<​wrap em>​ggplot()+theme_set(theme_classic())</​wrap>​を用いるのですが、具体的な方法を記載させていただきたいと思います。 基本的には、<​wrap em>​ggplot()+theme_set(theme_classic())</​wrap>​を用いるのですが、具体的な方法を記載させていただきたいと思います。
 +
 +===== 開発環境 =====
 +https://​rstudio.cloud/​
 +
 +2018年8月現在、メールアドレスを登録するのみで、無料です。
 +
 +[[https://​rstudio.cloud/​|RStudio Cloud]]のconsole画面(画面左下)で、<​wrap hi><​wrap em>​install.packages("​tidyverse"​)</​wrap></​wrap>​を入力して、tidyverseパッケージをインストールした状態とします。
 +
 +{{:​pasted:​20180813-231913.png}}
 +
 +インストール終了後の画面
 +
 +{{:​pasted:​20180813-232101.png}}
 +
 +参考:http://​twosquirrel.mints.ne.jp/?​p=26918
 +
 +===== Rmdファイルの新規作成と保存 =====
 +File > New File > R Notebook で、R Notebookファイルを新規作成。
 +
 +{{:​pasted:​20180813-232234.png}}
 +
 +{{:​pasted:​20180813-232303.png}}
 +
 +以下のようにR Notebookファイルが作成されるので、
 +
 +
  
 ===== 1.サマリー作成用の関数の定義 ===== ===== 1.サマリー作成用の関数の定義 =====
ライン 147: ライン 173:
 library(tidyverse) library(tidyverse)
  
-ggplot(tgc, aes(x=key, y=value, shape=supp, group = supp)) ++tg <- ToothGrowth 
 +tgc <- summarySE(tg,​ measurevar="​len",​ groupvars=c("​supp","​dose"​)) 
 + 
 +ggplot(tgc, aes(x=dose, y=len, shape=supp)) +
     theme_set(theme_classic()) +     theme_set(theme_classic()) +
-  ​ + 
-    ylim(230300) ++    ylim(040) +
     ​     ​
     ggtitle("​Figure 3") +     ggtitle("​Figure 3") +

ggplot2で論文用の白黒折れ線グラフ.1534047018.txt.gz · 最終更新: 2018/10/07 (外部編集)