[miso-users] sashimi matplotlib complaint about DISPLAY environment variable -- fix import
Yarden Katz
yarden at MIT.EDU
Tue Dec 4 09:28:04 EST 2012
Dear Sol,
The matplotlib backends are very system specific, so this can sometimes happen. Some people use the Agg backend, other GTK, and it really depends on what OS you have and what desktop environment. The good news is that these system specific backends only matter when you're trying to plot things interactively. Since sashimi_plot is not interactive and spits out only a PDF, the solution is to use a PDF backend:
matplotlib.use("pdf")
In other words, the DISPLAY variable and other things are irrelevant to producing a PDF -- even if your node didn't have X11 at all, it should be able to serialize a PDF. This will be incorporated into the next version.
Best, --Yarden
On Dec 3, 2012, at 9:08 PM, Sol Katzman wrote:
> Dear Yarden,
>
> I was getting crashes when trying to run sashimi on cluster nodes that have no display.
>
> The problem was that the initializing call to matplotlib was failing because of no
> DISPLAY environment variable. Or, the inability to connect to the $DISPLAY if I
> tried to set one.
>
> A local matplotlib guru gave me the fix, which is to tell matplotlib to "use a different backend."
>
> WAS:
> import matplotlib
>
> IS:
> import matplotlib
> matplotlib.use('Agg')
>
>
> Please consider changing Sashimi.py in the next release to incorporate this fix.
>
> Thanks,
> /Sol.
> _______________________________________________
> miso-users mailing list
> miso-users at mit.edu
> http://mailman.mit.edu/mailman/listinfo/miso-users
More information about the miso-users
mailing list