Description Usage Arguments See Also Examples
Plot the MSL atmospheric pressure through time.
1 2 3 4 5 6 7 8 9 |
x |
a cfPressure object. |
y |
missing. |
ggtheme |
character string (partially) matching the
|
scales |
character string partially matching the |
n_col |
the number of columns of plots (default 1). |
... |
further arguments passed to |
plot,cfDataList,missing-method
for general
information on default plotting of cfData
and cfDataList
objects, and the links within. See cf_query
for creating
cfPressure
objects.
Refer to theme
for more possible arguments to pass
to these methods.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## Not run:
# Retrieve public hourly atmospheric pressure data for the last 30 days at
# Reefton Ews station
# Subtract 30 days from today's date to get the start date
last_month = paste(as.character(Sys.Date() - 30), 0)
reefton_pressure = cf_query(cf_user(), cf_datatype(7, 1, 1), cf_station(),
start_date = last_month)
class(reefton_pressure) # cfPressure object
# Plot the atmospheric pressure data using the defaults
plot(reefton_pressure)
# Enlarge the text and add the observations as points
library(ggplot2) # for element_text() and geom_point()
plot(reefton_pressure, ggtheme = "bw", text = element_text(size = 16)) +
geom_point(size = 3, shape = 1)
# Save the plot as a png to the current working directory
library(ggplot2) # for ggsave()
ggsave("my_pressure_plot.png")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.