Matplotlib chooses Xwindows backend by default. You need to set matplotlib to not use the Xwindows backend.
Add this code to the start of your script (before importing pyplot) and try again:
import matplotlib matplotlib.use('Agg')
Or add to .config/matplotlib/matplotlibrc
line backend: Agg
to use non-interactive backend.
echo "backend: Agg" > ~/.config/matplotlib/matplotlibrc
Or when connect to server use ssh -X remoteMachine
command to use Xwindows.
Also you may try to export display: export DISPLAY=mymachine.com:0.0
.
For more info: https://matplotlib.org/faq/howto_faq.html#matplotlib-in-a-web-application-server
Related Posts:
- _tkinter.TclError: no display name and no $DISPLAY environment variable
- matplotlib error – no module named tkinter
- matplotlib error – no module named tkinter
- How to update a plot in matplotlib?
- ImportError: DLL load failed: The specified module could not be found
- Purpose of “%matplotlib inline”
- Purpose of “%matplotlib inline”
- RuntimeWarning: invalid value encountered in divide
- Is “from matplotlib import pyplot as plt” == “import matplotlib.pyplot as plt”?
- ValueError: operands could not be broadcast together with shapes (5,) (30,)
- matplotlib savefig() plots different from show()
- Plotting a 2D heatmap with Matplotlib
- ImportError: No module named ‘Tkinter’
- No handles with labels found to put in legend
- How to plot a histogram using Matplotlib in Python with a list of data?
- In Matplotlib, what does the argument mean in fig.add_subplot(111)?
- How can I plot a confusion matrix? [duplicate]
- Unable to plot Double Bar, Bar plot using pyplot for ndarray
- How to pip or easy_install tkinter on Windows
- tkinter gui with progress bar
- filedialog, tkinter and opening files
- pandas DataFrame “no numeric data to plot” error
- How to change the font size on a matplotlib plot
- How can I create a dropdown menu from a List in Tkinter?
- Permission denied error by installing matplotlib
- Updating matplotlib in virtualenv with pip
- How do I insert a JPEG image into a python Tkinter window?
- TypeError: generatecode() takes 0 positional arguments but 1 was given
- How do you change the size of figures drawn with Matplotlib?
- How do I set the figure title and axes labels font size in Matplotlib?
- Is there a list of line styles in matplotlib?
- Matplotlib automatic legend outside plot
- takes 1 positional argument but 2 were given
- Add Legend to Seaborn point plot
- How to pass arguments to a Button command in Tkinter?
- Tkinter scrollbar for frame
- Plotting multiple different plots in one figure using Seaborn
- Change figure size and figure format in matplotlib
- Add Legend to Seaborn point plot
- TypeError: ‘DataFrame’ object is not callable
- Improve subplot size/spacing with many subplots in matplotlib
- How do I plot only a table in Matplotlib?
- Python equivalent to ‘hold on’ in Matlab
- Overcome ValueError for empty array
- Using %matplotlib notebook after %matplotlib inline in Jupyter Notebook doesn’t work
- Display image as grayscale using matplotlib
- Create own colormap using matplotlib and plot color scale
- Why matplotlib does not plot?
- reducing number of plot ticks
- How to increase plt.title font size?
- Modify the legend of pandas bar plot
- Plot a horizontal line using matplotlib
- Remove xticks in a matplotlib plot?
- How to add title to seaborn boxplot
- How to use an image for the background in tkinter?
- ValueError: x and y must be the same size
- ValueError: Unknown projection ‘3d’ (once again)
- How to change plot background color?
- Function to close the window in Tkinter
- raise LinAlgError(“SVD did not converge”) LinAlgError: SVD did not converge in matplotlib pca determination
- TypeError: Invalid dimensions for image data when plotting array with imshow()
- Windows- Pyinstaller Error “failed to execute script ” When App Clicked
- matplotlib does not show my drawings although I call pyplot.show()
- Linear regression with matplotlib / numpy
- How to save a Seaborn plot into a file
- Plot correlation matrix using pandas
- Scatter plot colorbar – Matplotlib
- matplotlib: how to draw a rectangle on image
- bbox_to_anchor and loc in matplotlib
- Python, Matplotlib, subplot: How to set the axis range?
- RuntimeError: Invalid DISPLAY variable
- How to plot an array in python?
- When I use matplotlib in jupyter notebook,it always raise ” matplotlib is currently using a non-GUI backend” error?
- Using Tkinter in python to edit the title bar
- Seaborn Lineplot Module Object Has No Attribute ‘Lineplot’
- IndexError: index 2 is out of bounds for axis 0 with size 2
- Difference between import tkinter as tk and from tkinter import
- Matplotlib plots: removing axis, legends and white spaces
- Label axes on Seaborn Barplot
- Plot a histogram such that the total area of the histogram equals 1
- matplotlib: plot multiple columns of pandas data frame on the bar chart
- Disable / Enable Button in TKinter
- How to change legend size with matplotlib.pyplot
- An equivalent function to matplotlib.mlab.bivariate_normal
- How to clear Tkinter Canvas?
- Superscript in Python plots
- IPython, “name ‘plt’ not defined”
- How to handle a Button click event
- Plotting a python dict in order of key values
- Pandas dataframe groupby plot
- tkinter gui layout using frames and grid
- MovieWriter ffmpeg unavailable; trying to use class ‘matplotlib.animation.PillowWriter’ instead
- Tkinter error: Couldn’t recognize data in image file
- How to plot normal distribution
- How do I tell Matplotlib to create a second (new) plot, then later plot on the old one?
- Strange Exception in Tkinter callback
- How do I compile my Python 3 app to an .exe?
- Installing Pylab/Matplotlib
- TypeError: zip argument #2 must support iteration
- numpy/scipy/ipython:Failed to interpret file as a pickle