# Plots PyPlot backend issue

**URL:** <https://discourse.julialang.org/t/plots-pyplot-backend-issue/75608>\
**Category:** General Usage\
**Tags:** pyplot, plots\
**Created:** [February 1, 2022, 10:52pm UTC](https://discourse.julialang.org/t/plots-pyplot-backend-issue/75608 "2022-02-01T22:52:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vepiteski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vepiteski/32/3746_2.png) [@vepiteski](https://discourse.julialang.org/u/vepiteski)\
**Post date:** [February 1, 2022, 10:52pm UTC](https://discourse.julialang.org/t/plots-pyplot-backend-issue/75608/1 "2022-02-01T22:52:19Z")

</div>

Hi

Using the pyplot backend triggered segmentation fault in the REPL. After uninstalling everything related to Plots and PyPlot, trying fresh environments, I reluctantly reinstalled ALL my julia setup from scratch.

Now, in an empty environment, I install ONLY Plots and PyPlot and execute the following simple test:

> using Plots  
> pyplot()
> 
> x = collect(0.0:0.1:10)  
> graphe = plot(sin.(x))

I may display the graph by issuing “graphe” in the REPL. Then, curiously, the window displaying the graph has the iconic menu of PyPlot in the _lower_ border while previously, it was in the _upper_ border of the window.

The worst part is that if I close the window and reissue “graphe” in the REPL, I no longer get the graph but as error, here are the first few lines of the (rather long) message, then the stacktrace follows:

> julia\> graphe  
> Error showing value of type Plots.Plot{Plots.PyPlotBackend}:  
> ERROR: PyError ($(Expr(:escape, :(ccall(#= /home/dussault/.julia/packages/PyCall/L0fLP/src/pyfncall.jl:43 =# @pysym(:PyObject\_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) \<class ‘\_tkinter.TclError’\>  
> TclError(‘invalid command name “.!navigationtoolbar2tk.!button2”’)  
> File “/home/testjulia/.julia/conda/3/lib/python3.9/site-packages/matplotlib/figure.py”, line 2784, in clear  
> self.clf(keep\_observers=keep\_observers)  
> File “/home/testjulia/.julia/conda/3/lib/python3.9/site-packages/matplotlib/figure.py”, line 2766, in clf  
> toolbar.update()  
> File “/home/testjulia/.julia/conda/3/lib/python3.9/site-packages/matplotlib/backend\_bases.py”, line 3302, in update  
> self.set\_history\_buttons()  
> File “/home/testjulia/.julia/conda/3/lib/python3.9/site-packages/matplotlib/backends/\_backend\_tk.py”, line 721, in set\_history\_buttons  
> self.\_buttons[‘Back’][‘state’] = state\_map[can\_back]  
> File “/home/testjulia/.julia/conda/3/lib/python3.9/tkinter/ **init**.py”, line 1657, in **setitem**  
> self.configure({key: value})  
> File “/home/testjulia/.julia/conda/3/lib/python3.9/tkinter/ **init**.py”, line 1646, in configure  
> return self.\_configure(‘configure’, cnf, kw)  
> File “/home/testjulia/.julia/conda/3/lib/python3.9/tkinter/ **init**.py”, line 1636, in \_configure  
> self.tk.call(\_flatten((self.\_w, cmd)) + self.\_options(cnf))

A week ago, I had no such issues but suddenly, an unexplained contamination led to the segmentation fault issue and my new fresh installation still has those strange behaviors.

Any suggestion will be much appreciated! In particular, I would appreciate comments from users that experienced such contaminations yielding systematically segmentation faults.

I use Ubuntu 20.04LTS and Julia Version 1.7.1 (2021-12-22)

JPD
