plot_TH function

Graph: Climate chart of temperature and humidity

Graph: Climate chart of temperature and humidity

The plot_TH function allows the user to build a column/line graph with climatic parameters of temperature (maximum, minimum and average) and relative humidity (UR) or precipitation. This chart is widely used in scientific work in agrarian science

plot_TH( tempo, Tmed, Tmax, Tmin, UR, xlab = "Time", yname1 = expression("Humidity (%)"), yname2 = expression("Temperature ("^o * "C)"), legend.H = "Humidity", legend.tmed = "Tmed", legend.tmin = "Tmin", legend.tmax = "Tmax", colormax = "red", colormin = "blue", colormean = "darkgreen", fillbar = "gray80", limitsy1 = c(0, 100), x = "days", breaks = "1 months", textsize = 12, legendsize = 12, titlesize = 12, linesize = 1, date_format = "%m-%Y", sc = 2.5, angle = 0, legend.position = "bottom", theme = theme_classic() )

Arguments

  • tempo: Vector with times
  • Tmed: Vector with mean temperature
  • Tmax: Vector with maximum temperature
  • Tmin: Vector with minimum temperature
  • UR: Vector with relative humidity or precipitation
  • xlab: x axis name
  • yname1: y axis name
  • yname2: Secondary y-axis name
  • legend.H: Legend column
  • legend.tmed: Legend mean temperature
  • legend.tmin: Legend minimum temperature
  • legend.tmax: Legend maximum temperature
  • colormax: Maximum line color (default is "red")
  • colormin: Minimum line color (default is "blue")
  • colormean: Midline color (default is "darkgreen")
  • fillbar: Column fill color (default is "gray80")
  • limitsy1: Primary y-axis scale (default is c(0,100))
  • x: x scale type (days or data, default is "days")
  • breaks: Range for x scale when x = "date" (default is 1 months)
  • textsize: Axis text size
  • legendsize: Legend text size
  • titlesize: Axis title size
  • linesize: Line size
  • date_format: Date format for x="data"
  • sc: Scale for secondary y-axis in relation to primary y-axis (declare the number of times that y2 is less than or greater than y1, the default being 2.5)
  • angle: x-axis scale text rotation
  • legend.position: Legend position
  • theme: ggplot2 theme

Returns

Returns row and column graphs for graphical representation of air temperature and relative humidity. Graph normally used in scientific articles

Examples

library(AgroR) data(weather) with(weather, plot_TH(tempo, Tmed, Tmax, Tmin, UR))

See Also

radargraph , sk_graph , barplot_positive , corgraph , plot_TH1 , spider_graph , line_plot

Author(s)

Gabriel Danilo Shimizu, shimizu@uel.br

Leandro Simoes Azeredo Goncalves

Rodrigo Yudi Palhaci Marubayashi