uwhpsc-2016 / homework4

Homework #4
0 stars 1 forks source link

Issue with making serial_heat.png #1

Open rachka opened 8 years ago

rachka commented 8 years ago

As soon as I pulled from my private repo to SMC and ran pip install mpi4py and also make lib, I attempted to run python test_homework4.py and received the following message:

QXcbConnection: Could not connect to display Aborted (core dumped)

akihis2 commented 8 years ago

In test_homework4.py, if you insert following lines before import matplotlib.pyplot as plt, it should work:

import matplotlib matplotlib.use('Agg')

jasheetz commented 8 years ago

I found this in an AMATH website on setting up SageMathCloud http://faculty.washington.edu/rjl/classes/am574w2015/smc.html

This is the second solution for plotting graphs. create a file ~/.config/matplotlib/matplotlibrc containing:

backend : Agg

Works for me.

rachka commented 8 years ago

Yeah it definitely did work. Thanks for the fix.

cswiercz commented 8 years ago

Thank you to @akihis2 and @jasheetz for figuring this out.

The problem is that SMC doesn't support the default Matplotlib image rendering system because, after all, there is no windowing system on SMC. Apparently my attempt to use plt.savefig() is insufficient because Matplotlib needs to first generate the default, "windowed" plot before saving it.

I'll create a patch using @akihis2 's fix in test_homework4.py.