plot_pq | R Documentation |

Given a time series of precipitation and streamflow, this function plots the two time series in the same figure, streamflows as a normal time series and preciitation as bars comming from the upper part of the plotting window.

```
plot_pq(p, ...)
## S3 method for class 'zoo'
plot_pq(p, q, ptype=c("original", "monthly"),
na.fill=c("remove", "linear", "spline"),
from=start(p), to=end(p), date.fmt=NULL, tz=NULL,
main=ifelse(ptype=="original", "Precipitation and Streamflows",
"Monthly Precipitation and Streamflows"),
xlab=ifelse(ptype=="original", "Time", "Month"),
ylab=c("P, [mm]", "Q, [m3/s]"),
p.col=ifelse(ptype=="original", "blue", "lightblue"),
q.col=ifelse(ptype=="original", "black", "blue"),
leg.title="", leg.text=c("P", "Q"),
q.pch=16, q.cex=0.3,
start.month=1,
plot.p.probs=TRUE, p.probs=c(0.25, 0.75),
p.alpha=0.8,
plot.q.probs=TRUE, q.probs=c(0.25, 0.75),
q.probs.col="lightskyblue1", q.probs.alpha=0.8,
labels=TRUE, labels.cex=0.8,
labels.p.dy=-median(daily2monthly(p, FUN=sum, na.rm=TRUE),
na.rm=TRUE)*1.1,
labels.q.dx=c(rep(-0.2,6), rep(0.2,6)),
labels.q.dy=rep(median(q, na.rm=TRUE)*1.3, 12),
...)
```

`p` |
zoo object with precipitation time series, with any time frequency. |

`q` |
zoo object with streamflow time series, with any time frequency. |

`ptype` |
Character indicating the type of plot to be produced. Valid values are: |

`na.fill` |
Character indicating how to fill any NA present in |

`from` |
Character indicating the starting date for subsetting |

`to` |
Character indicating the ending date for subsetting |

`date.fmt` |
character indicating the format in which the dates are stored in |

`tz` |
character, with the specification of the time zone used for If This argument can be used when working with sub-daily zoo objects to force using time zones other than the local time zone for |

`main` |
The main title (on top) of the figure. |

`xlab` |
a title for the |

`ylab` |
a two-element title for the |

`p.col` |
character, representing the colors to be used for ploting the precipitation time series. |

`q.col` |
character, representing the colors to be used for ploting the streamflow time series. |

`leg.title` |
a character string or length-one expression giving a title to be placed at the top of the legend. |

`leg.text` |
a two-element character to appear in the legend placed at the bottom of the figure. |

`q.pch` |
numeric, representing the symbols used for ploting the streamflow time series. |

`q.cex` |
a numerical vector giving the amount by which plotting characters and symbols should be scaled relative to the default. This works as a multiple of |

`start.month` |
numeric in [1:12] indicating the starting month for the monthlycurve. Numeric values in [1, 12] represents months in [January, December]. By default |

`plot.p.probs` |
logical used to decide whether to show lower an upper uncertainty values for each one of the 12 monthly precipitation values. By default |

`p.probs` |
numeric of length 2. It defines the quantile values used to compute the lower an upper uncertainty values for each one of the 12 monthly precipitation values. This uncertainty values are drawn as vertical lines over the bars used to plot the 12 monthly precipitation values. |

`p.alpha` |
numeric of length 1, with the factor used to modify the opacity of |

`plot.q.probs` |
logical used to decide whether to show uncertainty bands around each one of the 12 monthly average or median streamflow values. By default |

`q.probs` |
numeric of length 2. It is used to define quantile values used to compute the lower an upper uncertainty bands around each one of the 12 monthly average or median streamflow. |

`q.probs.col` |
character with the color used to plot the uncertainty bands around the average or median streamflow values. |

`q.probs.alpha` |
numeric of length 1, with the factor used to modify the opacity of |

`labels` |
logical. Should monthly streamflow values to be shown above the lines?. By default |

`labels.cex` |
numeric giving the amount by which plotting characters used to show the numeric values of monthly streamflow values are scaled relative to the default. |

`labels.p.dy` |
numeric of length 12 giving the amount of vertical coordinate positions that have to be used to vertically shift the labels of monthly precipitation values. |

`labels.q.dx` |
numeric of length 12 giving the amount of horizontal coordinate positions that have to be used to horizontally shift the labels of monthly streamflow values. |

`labels.q.dy` |
numeric of length 12 giving the amount of vertical coordinate positions that have to be used to vertically shift the labels of monthly streamflow values. |

`...` |
further arguments passed to or from other methods. Not used yet. |

Given a time series of precipitation and streamflow, this function plots the two time series in the same figure, streamflows as a normal time series and precipitation as bars comming from the upper part of the plotting window.

A figure with the two time series in the same graphical area, streamflows as a normal time series and precipitation as bars comming from the upper part of the plotting window.

Mauricio Zambrano-Bigiarini, mzb.devel@gmail

`hydroplot`

, `climograph`

, `fdc`

, `fdcu`

, `monthlyfunction`

```
######################
## Ex1: Plotting precipitation and streamflows for the full time period of both
## time series.
## First, we load the daily P and Q time series for the Cauquenes en
## El Arrayan catchment. P, [mm] is the first column and Q, [mm] is the
## fifth column.
data(Cauquenes7336001)
p <- Cauquenes7336001[, 1]
q <- Cauquenes7336001[, 5]
## Plotting P and Q for the full time period of both time series
plot_pq(p=p, q=q)
######################
## Ex2: Plotting precipitation and streamflows only for a specific time period,
## from April to December 2000.
plot_pq(p, q, from="2000-04-01", to="2000-12-31")
######################
## Ex3: Plotting monthly values of precipitation and streamflows for the
## full time period of both time series.
plot_pq(p, q, ptype="monthly")
######################
## Ex4: Plotting monthly values of precipitation and streamflows for the
## full time period of both time series, but using a hydrologic year
## starting on April
plot_pq(p, q, ptype="monthly", start.month=4)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.