-
Notifications
You must be signed in to change notification settings - Fork 25
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
Now let user specify X11 backend with "export MPLBACKEND="tkagg" (or "MacOSX") #275
Conversation
gcpy/examples/plotting/plot_comparisons.py - Remove import for matplotlib.use as mpl_use - Remove statement calling mpl_use("tkagg") gcpy/examples/plotting/plot_single_panel.py - Remove import for matplotlib.use as mpl_use - Remove statement calling mpl_use("tkagg") - Fixed error in calling rename_and_flip_gchp_rst_vars; now pass dset to this function. This was a cut-n-paste error. CHANGELOG.md - Updated accordingly
We will also need to update the GCPy RTD documentation accordingly. |
I also suspect the version of the MacOSX operating system might matter. |
Update: On MacOSX Sonoma 14.1.1, I was able to set export MPLBACKEND=tkagg in both the Mac terminal window and on a remote machine (Cannon). The sample program above was able to display the plot shown in the previous comment to the screen. I wonder if updating the OS solves the issue. |
I was finally able to get it to work using this solution. I think the key was executing the command in the Mac terminal window as well. Thanks! Good to merge now! |
This is the companion PR for issue #269. In example scripts
gcpy/examples/plotting/plot_single_panel.py
andgcpy/examples/plotting/plot_comparisons.py
, we had set the X11 backend for Matplotib totkagg
(from the Tcl/Tk library). The X11 backend is necessary so that these example scripts can open a plot window on the screen.However, the
tkagg
backend is not compatible on MacOSX. Therefore, rather than hardcoding a value for the X11 backend, we will let the user pick the proper value by setting either: