Skip to content

Commit ca9261c

Browse files
Update Saving Plots section to reference ospsuite.plots::exportPlot
Co-authored-by: KatrinCoboeken <28564329+KatrinCoboeken@users.noreply.github.com>
1 parent 8b63262 commit ca9261c

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

vignettes/plotting-with-ospsuite-plots.Rmd

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,13 +299,26 @@ print(p)
299299

300300
## Saving Plots
301301

302-
Since all functions return `ggplot2` objects, you can save them using `ggsave()`:
302+
Since all functions return `ggplot2` objects, you can save them using `ospsuite.plots::exportPlot()`:
303303

304304
```{r save, eval=FALSE}
305305
# Create a plot
306306
myPlot <- plotTimeProfile(myDataCombined)
307307
308-
# Save to file
308+
# Save to file using ospsuite.plots::exportPlot
309+
ospsuite.plots::exportPlot(
310+
plotObject = myPlot,
311+
filePath = "timeprofile.png",
312+
width = 8,
313+
height = 6,
314+
dpi = 300
315+
)
316+
```
317+
318+
Alternatively, you can use the standard `ggsave()` function from `ggplot2`:
319+
320+
```{r save-ggsave, eval=FALSE}
321+
# Save using ggsave
309322
ggsave("timeprofile.png", myPlot, width = 8, height = 6, dpi = 300)
310323
```
311324

0 commit comments

Comments
 (0)