Closed juandemedel closed 2 years ago
Hi @juandemedel, pavo's plot()
and aggplot()
etc. mostly just use base graphics, so you don't need to do anything pavo-specific. There are many ways to achieve that kind of thing via fiddling with the margins & options on base graphics, or using packages like magick
(which pavo uses in places) or imager
for adding photographs. Examples
# Library
library(pavo)
# Spectral data
data(flowers)
# Plot main spec figure
par(fig = c(0, 1, 0, 1))
aggplot(flowers)
# Plot inset spec figure, and control it's location with 'fig'
par(fig = c(0.01, 0.35, 0.5, 1), new = TRUE)
aggplot(flowers,
xaxt = 'n',
yaxt = 'n',
xlab = '',
ylab = '',
shadecol = 'forestgreen',
lcol = 'black')
or the same using pavo's image-handling abilities and fiddling with base plot options just like above:
# Library
library(pavo)
# Load flower spectra
data(flowers)
# Load a built-in image in pavo
papilio <- getimg(system.file("testdata/images/butterflies/papilio.png", package = "pavo"))
# Plot main figure
par(fig = c(0, 1, 0, 1))
aggplot(flowers)
# Add image
par(fig = c(0.01, 0.35, 0.5, 1), new = TRUE)
plot(papilio,
axes = FALSE,
xlab = '',
ylab = '',
main = '')
Hello dear community @Bisaloo, @thomased. I have been working with pavo to plot light spectrums on an aggplot. Besides, I have several plots and photographs that I would like to put into one plot (e.g insets). Thereby, I am wondering if there is a way to do so? Would you please give me some advice?