I keep getting the error “name plot is not defined” even though I run the line import matplotlib and I tried many importing lines but it doesn’t work, when I run all cells it gives me a message that the kernal died when running the plotting commands and they don’t run. Thank you so much for your help.
This is an error from Python telling you that the name plot
is not a name that Python knows about and not a Matplotlib specific error. Based in this information there is not much we can do to help (other than to speculate you meant to type plt
rather than plot
?).
Could you please provide a minimal example (as text not as a screen shot) of the code you are running that reproduces the problem you are having?
Thank you so much for your help! This error was showing to me when I was trying to run this cell individually, but when I restarted the kernal it ran the cells consequently and it didn’t show the error but the kernal keeps crashing, provided a screenshot to what happens, and here’s the script, also for it to run: conda install openmc_source_plotter;
%matplotlib inline
import openmc
import openmc_source_plotter
my_source = openmc.Source()
my_source.energy = openmc.stats.muir(e0=14080000.0, m_rat=5.0, kt=20000.0)
plot = my_source.plot_source_energy()
plot.show()
I tried using plt instead of plot but still the kernal crashes,