+ ckb_style()
does
three things to a ggplot2 plot:
Make a scatter plot with ggplot
.
Use + ckb_style()
to apply a CKB theme, add separated
axis lines and fix the aspect ratio.
Or apply just a CKB theme and use axis lines.
Set axis limits.
If you do not want a gap between the axes, set
gap = c(0, 0)
.
Change the aspect ratio of the plot.
Set the width of the plot (width
controls the length of
the x axis).
The colour
arguments of theme_ckb()
and
ckb_style()
can be used to change the colour of the
non-data components of the plot.
The plot.margin
arguments of theme_ckb()
and ckb_style()
can be used to adjust the margin around the
plot.
If you wish to override some aspect of the theme applied by
ckb_style()
or theme_ckb()
, then this can be
done by adding a theme after + ckb_style()
,
If any data points you are plotting fall outside the axes, then they will still be drawn and may show up in places such as the axes, the legend, the plot title, or the plot margins. There is also no warning if data points fall outside the whole plot area.
So it is best to check that your xlim
and
ylim
values are suitable for your data before using the
function.