台風が来そうで来ない@関東。
Rでの解析の一例として、台風の軌道とか強さとかを処理してみよう。
台風のデータは実験心理学のデータに近いので、その手の解析には応用できると思います。
台風が来そうで来ない@関東。
Rでの解析の一例として、台風の軌道とか強さとかを処理してみよう。
台風のデータは実験心理学のデータに近いので、その手の解析には応用できると思います。
The examples below show colorbar legends in ggplot2.
Please note that this is alpha version and it is not sure if this implementation appears in the future version of ggplot2.
I’m happy if you play with this function and report potential bugs and missing functions.
To test this, you need install Hadley’s scales package and my implementation based on Hadley’s ggplot2.
Here is a direct link to the tarball:
The colorbar is controlled by passing the legend_param
argument to scale_{fill, colour}_XXX
. XXX needs to be continuous family, e.g., discrete, etc.
The legend_param
needs to be a list. Currently three elements is available.
colorbar
(logical): draw colorbar if TRUE.colorbar_nbin
(integer): the number of division of colorbar, i.e., the resolution of the colorbar default: approx. 20).colorbar_nbreaks
(integer): the number of breaks of the colorbar (default: approx. 5).The size of colorbar is controlled by theme – legend.key.size
, legend.key.width
, and legend.key.height
.
The breaks and labels can be controlled via breaks
and labels
arguments in scale_*, this is same as normal legend.
Probably one of the most frequently asked question is that geom_line() does not draw lines.
This is because x variable is factor.
ggplot2 does not support drawing image files by default, but it is easy to draw images for background using ggplot2.