I am on Mac OS 10.14.4. I have python installed in miniconda3 environment. Below is the list of packages with "conda list"
The issue I am having is when I run "python" in the terminal and open the shell I try to run the codes one by one.
import openmc
sp1 = openmc.StatePoint('statepoint.550-20.h5')
tally1 = sp1.tallies[1]
flux1 = tally1.mean.ravel()
import matplotlib.pyplot as plt
import numpy as np
y = np.reshape(flux1, (200,200))
plt.imshow(y, cmap=plt.cm.viridis)
plt.show()
The issue I am having is after running plt.show()
the plot window opens showing a white screen without any image in there. Now if I run plt.savefig('19.7fast.png')
instead of plt.show()
i can save the image in the directory where I run the python shell in terminal.
When I run import matplotlib.pyplot as plt; plt.get_backend()
in python shell I see 'TkAgg'
, Now I tried changing to plt.switch_backend('MacOSX')
, because I looked some similar issue and similar solution. But, this gives me the error
ImportError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)Conda please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more information.
Any help to resolve this issue is much appriciated