View source: R/plot_run_vars.R
plot_run_vars | R Documentation |
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"
)
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. |
Response obtained from the /api/run/{run_id}/graph/{year}/{y_var}
endpoint
Tezan Sahu
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")
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.