GeoscienceAustralia / mtpy2

This Repository has been moved to https://github.com/MTgeophysics/mtpy
GNU General Public License v3.0
5 stars 1 forks source link

examples/modem_plotmodel2.py DepthSlice does not work in Windows or Linux VDI #11

Closed kodexp closed 7 years ago

kodexp commented 7 years ago

fxz547@vdi-n23 /g/data/ha3/fxz547/Githubz/mtpy2 (develop) $ python examples/modem_plotmodel2.py /g/data/ha3/fxz547/Githubz/mtpy2/examples/data/ModEM_files/VicSynthetic07 DepthSlice If you want to write a vtk file for 3d viewing, you need download and install evtk from https://bitbucket.org/pauloh/pyevtk Note: if you are using Windows you should build evtk first witheither MinGW or cygwin using the command: python setup.py build -compiler=mingw32 or python setup.py build -compiler=cygwin If you want to write a vtk file for 3d viewing, you need download and install evtk from https://bitbucket.org/pauloh/pyevtk Note: if you are using Windows you should build evtk first witheither MinGW or cygwin using the command: python setup.py build -compiler=mingw32 or python setup.py build -compiler=cygwin ('plot type is', 'DepthSlice') /g/data/ha3/fxz547/Githubz/mtpy2/examples/data/ModEM_files/VicSynthetic07/Modular_MPI_NLCG_019.rho

###################################### (this was the python2.7.3,not the Anaconda python 2.7.12) u25656@PC-62907 /e/Githubz/mtpy2 (develop)

$ python examples/modem_plotmodel2.py ./examples/data/ModEM_files/VicSynthetic07 DepthSlice

Note: need scipy version 0.14.0 or higher or interpolation might not work. If you want to write a vtk file for 3d viewing, you need download and install evtk from https://bitbucket.org/pauloh/pyevtk Note: if you are using Windows you should build evtk first witheither MinGW or cygwin using the command: python setup.py build -compiler=mingw32 or python setup.py build -compiler=cygwin If you want to write a vtk file for 3d viewing, you need download and install evtk from https://bitbucket.org/pauloh/pyevtk Note: if you are using Windows you should build evtk first witheither MinGW or cygwin using the command: python setup.py build -compiler=mingw32 or python setup.py build -compiler=cygwin ('plot type is', 'DepthSlice') ./examples/data/ModEM_files/VicSynthetic07\Modular_MPI_NLCG_019.rho Traceback (most recent call last): File "C:\Python27\lib\site-packages\matplotlib\backends\backend_qt4.py", line 156, in lambda: self.close_event()) File "C:\Python27\lib\site-packages\matplotlib\backend_bases.py", line 1564, in close_event self.callbacks.process(s, event) AttributeError: 'FigureCanvasQTAgg' object has no attribute 'callbacks'

Reason perhaps due to use a older python and scipy version!

zhang01GA commented 7 years ago

It may have just saved a png file: @ubuntu-qosmio /Softlab/Githubz/mtpy2 (develop) $ ls -l examples/data/ModEM_files/VicSynthetic07/Depth_20_4.9000.png -rw-rw-r-- 1 fzhang fzhang 70597 Nov 28 20:26 examples/data/ModEM_files/VicSynthetic07/Depth_20_4.9000.png

kodexp commented 7 years ago

Fixed. Added plt.show(). Make sure to use newer version of python (anaconda python2.7.12)