ユーザ用ツール

サイト用ツール


ggplot2でタイトルとx軸y軸の設定

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
次のリビジョン両方とも次のリビジョン
ggplot2でタイトルとx軸y軸の設定 [2018/08/12] – [x軸の値が離散値(?)の場合] adash333ggplot2でタイトルとx軸y軸の設定 [2020/08/12] – [軸のラベルの書き換え] adash333
行 9: 行 9:
 ===== 開発環境 ===== ===== 開発環境 =====
  
-RStudio Cloudのconsole画面(画面左下)で、install.package("tidyverse")を入力して、tidyverseパッケージをインストールした状態とします。+RStudio Cloudのconsole画面(画面左下)で、install.packages("tidyverse")を入力して、tidyverseパッケージをインストールした状態とします。
  
 参考:http://twosquirrel.mints.ne.jp/?p=26918 参考:http://twosquirrel.mints.ne.jp/?p=26918
行 15: 行 15:
 ===== グラフタイトルをグラフ上部中央に記載する ===== ===== グラフタイトルをグラフ上部中央に記載する =====
  
 +
 +<code>
 +ggplot() +
 +  ggtitle("Use theme(plot.title = element_text(hjust = 0.5)) to center") +
 +  theme(plot.title = element_text(hjust = 0.5))
 +</code>
 +
 +参考:https://codeday.me/jp/qa/20190317/372133.html
  
 ===== x軸の値を変更する ===== ===== x軸の値を変更する =====
行 62: 行 70:
 </code> </code>
  
 +===== 軸のラベルの書き換え =====
  
 +<code>
 +# y軸のラベルの書き換え
 +labs(y="Length")
 +</code>
 ===== グループによって少しだけx軸方向にずらす ===== ===== グループによって少しだけx軸方向にずらす =====
  
行 92: 行 105:
 <iframe style="width:120px;height:240px;" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" src="//rcm-fe.amazon-adsystem.com/e/cm?lt1=_blank&bc1=000000&IS2=1&bg1=FFFFFF&fc1=000000&lc1=0000FF&t=twosquirrel-22&language=ja_JP&o=9&p=8&l=as4&m=amazon&f=ifr&ref=as_ss_li_til&asins=487311814X&linkId=0c89d7378632a8fa2f9442eb6408bf53"></iframe> <iframe style="width:120px;height:240px;" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" src="//rcm-fe.amazon-adsystem.com/e/cm?lt1=_blank&bc1=000000&IS2=1&bg1=FFFFFF&fc1=000000&lc1=0000FF&t=twosquirrel-22&language=ja_JP&o=9&p=8&l=as4&m=amazon&f=ifr&ref=as_ss_li_til&asins=487311814X&linkId=0c89d7378632a8fa2f9442eb6408bf53"></iframe>
 </html> </html>
 +
 +===== リンク =====
 +目次:[[初めての医療統計:index.html|初めての医療統計 目次]]
 +
 +
 +

ggplot2でタイトルとx軸y軸の設定.txt · 最終更新: 2020/08/12 by adash333

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki