Can't plot in jupyter notebook

Hello everyone,

I was trying to plot the hexagonal lattice in the openmc examples online but I keep getting an error when I try to do it, here I was trying to plot a distribution for a source and I got this error, what should I do? Thank you so much for your help!

when I try to restart the kernal and run all the cells it keeps giving me this message and it doesbn’t run the plotting cells.

Not being able to see the rest of the cells in the notebook, it’s hard to say, but the matplotlib.pyplot object is often imported with the name plt rather than plot (i.e. from matplotlib import pyplot as plt).

Is it possible that is the case here?

Thank you so much for your help, I tried it but unfortunately I keep getting the same error, could it be due to that I’m using ubuntu on VM?

I tried to run it but the kernal keeps dying when it arrives to the last two cells which include plotting, this is not on VM so I see this wasn’t a factor:

I tried this, too:

Pinging @Shimwell, who is the author of the openmc_source_plotter package. Perhaps he has thoughts on what could be going wrong here.

Thank you so much for your help! Could the problem be with the openmc source plotter, if I’m going to replace it with the usual way to plot and get a distribution how would I do it? Also I was trying the lines in the link here and I get an error when I try plotting, too: Post Processing — OpenMC Documentation

I’ve got no idea regarding the jupyter kernal crashing, I tried to reproduce the error over here, but everything works fine over here. I guess it is a local install issue which python is famous for

This last screen shot is not the openmc-source-plotter but rather a openmc.plot_geometry call. The error message suggests that the cross section xml file can’t be found.

This question regarding setting the cross-section file has come up a few times before, perhaps this post might help OpenMC cross_section.xml problem - #2 by Pranto

Alternatively, the recently released openmc version 0.13.2 introduces a new config option for setting the variable which 3. Data Configuration — OpenMC Documentation

openmc.config['cross_sections'] = 'path_to_cross_sections.xml'

Thank you so much for your help! I followed the steps in the post you mentioned but I still got the same error, I’m not sure what I did wrong, here’s what I typed in the terminal, I still get the error no cross sections. xml file was specified, I downloaded ENDF/B-VII.1 and my openmc version is 0.13.1, I’m using ubuntu

I finally got it! After fixing the cross sections. xml file error it worked!