library(mie)
require(tidyr)
require(ggplot2)
n_sp = 2.5
n_m = 1.5
scale = 10
a = scale*1
wavelength = scale*seq(2,20,length=1e3)
cross_sections = mie(wavelength, n_sp^2, radius=a,
medium=n_m, efficiency=TRUE)
m = pivot_longer(cross_sections, cols=c("extinction"))
m$x = n_m*2*pi/m$wavelength * a
ggplot(m, aes(x, value))+
geom_line() +
labs(x="x", y=expression(sigma/(pi*a^2)), colour="")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.