Plot and Analyze Heatwave Events
Source:R/sus_climate_plot_heatwaves.R
sus_climate_plot_heatwaves.RdVisualizes and analyzes the results from sus_climate_compute_heatwaves().
It provides multiple visualization types including time series of events,
calendar heatmaps, intensity distributions, and annual summaries.
Usage
sus_climate_plot_heatwaves(
hw_result,
type = c("timeline", "calendar", "intensity", "trend"),
station_code = NULL,
method = NULL,
year = NULL,
interactive = TRUE,
color_palette = "npg",
lang = "en",
save_plot = NULL
)Arguments
- hw_result
List. The output from
sus_climate_compute_heatwaves().- type
Character. Type of plot to generate:
"timeline": Gantt-style timeline of heatwave events."calendar": Calendar heatmap showing days with heatwaves."intensity": Scatter plot of duration vs. intensity (EHF peak)."trend": Bar chart of number of events per year.
- station_code
Character. Optional. Filter by a specific station code.
- method
Character. Optional. Filter by a specific method (e.g., "EHF", "INMET").
- year
Numeric. Optional. Filter by a specific year (useful for calendar plots).
- interactive
Logical. If
TRUE, returns an interactive Plotly chart. IfFALSE, returns a static ggplot2 chart. Default isTRUE.- color_palette
Character. Name of the ggsci color palette to use. Default is
"npg".- lang
Character. Language for labels and titles:
"en"(English),"pt"(Portuguese), or"es"(Spanish). Default is"en".- save_plot
Character. Optional file path to save the plot (e.g., "plot.html" or "plot.png").