## 1. Prepare a deconvoluted spectrum as input
spec <- read_spectrum(metabodecon_file("sim/sim_01"))
decon <- generate_lorentz_curves_sim(spec)
## 2.1. Plot the full (non-deconvoluted) spectrum
## 2.2. Remove connecting lines, and focus on a specific region specified in ppm
## 2.3. Show second derivative and focus on a specific region specified as fraction
## 2.4. Change color of focus rectangle and margins of sub figure 1
## 2.5. Hide xlab and show second derivative
## 2.6. Change the figure region for sub figure 1
plot_spectrum(spec, sub1 = FALSE)
plot_spectrum(decon, foc_rgn = c(3.49, 3.45), con_lines = FALSE)
plot_spectrum(decon, sub2 = TRUE, foc_frac = c(0.40, 0.30))
plot_spectrum(decon,
sub1 = list(mar = c(3, 6, 3, 6), lt_axis = list(col = "violet")),
foc_rect = list(border = "violet", col = transp("violet")),
con_lines = list(col = "violet")
)
plot_spectrum(decon,
sub2 = TRUE,
sub3 = list(bt_text = list(text = "")),
frame = TRUE,
con_lines = FALSE
)
plot_spectrum(decon, sub1 = list(fig_rgn_npc = c(0,1,.3,1), mar = c(0,5,0,0)))
Run the code above in your browser using DataLab