Graphics Reference
In-Depth Information
In this example we can make the plot a little prettier by reversing the legend, using a different
palette, adding an outline, and setting the breaks to some more familiar numbers (
Figure 8-34
):
ggplot(wind, aes(x
=
DirCat, fill
=
SpeedCat))
+
geom_histogram(binwidth
=
15
, origin
=
-7.5
, colour
=
"black"
, size
=
.25
)
+
guides(fill
=
guide_legend(reverse
=
TRUE
TRUE
))
+
coord_polar()
+
scale_x_continuous(limits
=
c(
0
,
360
), breaks
=
seq(
0
,
360
, by
=
45
),
minor_breaks
=
seq(
0
,
360
, by
=
15
))
+
scale_fill_brewer()