Hello !
I am new to julia programming language and I am trying to do tutorial for group distribution plot as mentioned in the script but everytime I am getting an error of UndefVarError: SolventGroup not defined
Stacktrace:
[1] top-level scope
@ ./REPL[38]:2
Kindly help me out to resolve this error. Here is the input
import Pkg; Pkg.activate(“.”)
using ComplexMixtures
using Plots
using LaTeXStrings
using EasyFit: movavg
Some default settings for the plots
plot_font = “Computer Modern”
Plots.default(
fontfamily=plot_font,
linewidth=1.5,
framestyle=:box,
label=nothing,
grid=false,
)
Load previusly saved results, computed in the previous script
results = load(“./mddf.json”)
Plot with two subplots
plot(layout=(2,1))
Plot the total mddf
plot!(
results.d,
movavg(results.mddf,n=10).x, # Smooth example with a running average
label=“Total”,
subplot=1
)
Plot DMF group contributions to the MDDF. We use a dictionary where
the keys are the group names, and the values are the atom names of the group
groups = (
“CO” => [“C”,“O”], # carbonyl
“N” => [“N”],
“Methyl groups” => [“CC”,“CT”,“HC1”,“HC2”,“HC3”,“HT1”,“HT2”,“HT3”],
)
for (group_label, group_atoms) in groups
# Retrieve the contributions of the atoms of this group
group_contrib = contributions(results, SolventGroup(group_atoms))
# Plot the contributions of this groups, with the appropriate label
plot!(
results.d,
movavg(group_contrib,n=10).x,
label=group_label,
subplot=1
)
end
Thanks in advance