Plot the desired variables from the results of a PEcAn run. Hits the /api/run/{run_id}/graph/{year}/{y_var} API endpoint

plot_run_vars(
  server,
  run_id,
  year,
  y_var,
  x_var = "time",
  width = 800,
  height = 600,
  filename = "plot.png"
)

Arguments

server

Server object obtained using the connect() function

run_id

ID of the PEcAn run whose details are needed

year

the year this data is for

width

the width of the image generated, default is 800 pixels.

height

the height of the image generated, default is 600 pixels.

filename

File name to save the generated plot, default is 'plot.png'.

yvar

the variable to plot along the y-axis.

xvar

the variable to plot along the x-axis, by default time is used.

Value

Response obtained from the /api/run/{run_id}/graph/{year}/{y_var} endpoint

Author

Tezan Sahu

Examples

server <- connect(url="http://pecan.localhost:80", username="carya", password="illinois")

# Plot the Gross Primary Productivity vs Time for the run with ID '99000000282' for the year 2002
plot_run_vars(server, run_id=99000000282, year=2002, y_var="GPP")
#> Sorry! Server not responding.

# Plot the Total Respiration vs Soil Respiration for the run with ID '99000000283' for the year 2002 of custom size
plot_run_vars(server, run_id=99000000283, year=2002, y_var="TotalResp", x_var="SoilResp", width=500, height=400)
#> Sorry! Server not responding.