Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to set matplotlib backend for remote plotting? #123

Closed
rjleveque opened this issue Dec 10, 2014 · 7 comments
Closed

Need to set matplotlib backend for remote plotting? #123

rjleveque opened this issue Dec 10, 2014 · 7 comments
Assignees

Comments

@rjleveque
Copy link
Member

PR #120 removed statements setting the backend to Agg if it's not already set.

Does this break plotting on remote machines where the backend is set by default to something that requires $DISPLAY to be set? I think it might, but need to investigate...

Should we add an attribute to ClawPlotData to allow the user to specify this directly in setplot.py, e.g.

   plotdata.mpl_backend = 'Agg'
@mandli
Copy link
Member

mandli commented Dec 10, 2014

I guess this would be a problem if the default is "tk agg" for instance and it was a remote machine. There are already ways for the backend to be set by default in matplotlib, I am not sure that we should override that behavior. Maybe we could detect if the DISPLAY variable is set properly and default to agg otherwise?

@cjvogl
Copy link

cjvogl commented Oct 30, 2015

Actually just had this issue using the HYAK cluster at UW... so it does come up now and then.

@mandli
Copy link
Member

mandli commented Oct 30, 2015

@cjvogl Do you have a workaround we could use in these cases?

@cjvogl
Copy link

cjvogl commented Oct 30, 2015

@mandli I added import matplotlib followed by matplotlib.use('Agg') to the very top of any plotting scripts. Not the most elegant solution, but it seems to have worked.

@mandli
Copy link
Member

mandli commented Oct 30, 2015

That is The recomended way to override the default backend actually. You can also set the default in a .matplotlibrc file on that machine (melt recommendation). I feel for advanced users running on headless machines that these types of work around are fairly painless where as a novice user might run into troubles if we override their default backend.

@ketch
Copy link
Member

ketch commented Feb 23, 2019

I guess we can just add this workaround to the documentation and close this issue.

@mandli
Copy link
Member

mandli commented Feb 23, 2019

Added issue clawpack/doc#205 to address this.

@mandli mandli closed this as completed Feb 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants