Creating figures without displaying them?

Dear mne experts,

I am trying to create figures without displaying them.

I have used Agg as follows:

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

ica.plot_sources, ica.plot_overlay and ica.plot_scores seem to work
correctly.

However, "fig = stc.plot(surface='inflated', hemi=hemi,
subjects_dir=subjects_dir, figure=i)" gives "ipython: cannot connect to X
server".

Any ideas what might be wrong?

Best,
Maria
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20170914/4309ed08/attachment.html

hi Maria,

stc.plot uses mayavi and opengl and not matplotlib.

to use it in "headless" mode ie without an x server see:

http://docs.enthought.com/mayavi/mayavi/tips.html#rendering-using-the-virtual-framebuffer

HTH
ALex

Many thanks!
I will try that.

Best,
Maria

2017-09-14 21:56 GMT+03:00 Alexandre Gramfort <alexandre.gramfort at inria.fr>:

hi Maria,

stc.plot uses mayavi and opengl and not matplotlib.

to use it in "headless" mode ie without an x server see:

Tips and Tricks — mayavi 4.8.1 documentation
rendering-using-the-virtual-framebuffer

HTH
ALex

Dear mne experts,

I am trying to create figures without displaying them.

I have used Agg as follows:

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

ica.plot_sources, ica.plot_overlay and ica.plot_scores seem to work
correctly.

However, "fig = stc.plot(surface='inflated', hemi=hemi,
subjects_dir=subjects_dir, figure=i)" gives "ipython: cannot connect to X
server".

Any ideas what might be wrong?

Best,
Maria

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to you
in error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to you in
error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20170916/004cc117/attachment.html