python-matplotlib not respecting env var MPLBACKEND=TkAgg

  • Open
  • quality assurance status badge
Details
One participant
  • Jake
Owner
unassigned
Submitted by
Jake
Severity
normal
J
(address . bug-guix@gnu.org)
CAJqVjv__iS+h7F9XuCFno46AFSxGpH8YkfZOZGFapFcHfxt3cA@mail.gmail.com
Hello

We are supposed to be able to control the backend used by Python's
Matplotlib via the MPLBACKEND environment variable [1]. This doesn't appear
to work for the TkAgg backend:

#+begin_src sh

guix shell python python-matplotlib -- bash -c 'MPLBACKEND=TkAgg python3
-c "import matplotlib; print(matplotlib.get_backend()); import
matplotlib.pyplot as plt; plt.plot([1],[2]); plt.show()"'

#+end_src

#+RESULTS:
: TkAgg
: <string>:1: UserWarning: FigureCanvasAgg is non-interactive, and thus
cannot be shown

However, the TkAgg backend does work if it is hardcoded in the Python
script using `matplotlib.use()`:

#+begin_src sh

guix shell python python-matplotlib -- python3 -c "import matplotlib;
matplotlib.use('TkAgg'); print(matplotlib.get_backend()); import
matplotlib.pyplot as plt; plt.plot([1],[2]); plt.show()"

#+end_src

#+RESULTS:
: TkAgg

Thanks
Jake

Attachment: file
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 70687@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 70687
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch