Reputation: 312
I am trying to generate a simple matplotlib figure as per below code in pycharm.
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 5, 11)
y = x ** 2
fig = plt.figure()
axes1 = fig.add_axes([0.1,0.1,0.8,0.8])
axes2 = fig.add_axes([0.2,0.5,0.4,0.3])
axes1.plot(x,y)
axes2.plot(y,x)
axes1.set_xlabel('X_1 label')
axes1.set_ylabel('Y_1 label')
axes1.set_title('Title_1')
axes2.set_xlabel('X_2 label')
axes2.set_ylabel('Y_2 label')
axes2.set_title('Title_2')
I am getting an error
/home/lk/anaconda3/envs/pycharm/bin/python "/home/lk/Desktop/Python Exps/pycharm/tr.py"
QStandardPaths: XDG_RUNTIME_DIR points to non-existing path '/run/user/1000/snap.pycharm-community', please create it with 0700 permissions.
Process finished with exit code 0
What is the meaning of this error and how can I make it go?
Upvotes: 5
Views: 18660
Reputation: 24874
Just create a directory using:
$ mkdir -p /run/user/1000/snap.pycharm-community
And change it's permissions like this:
$ chmod 0700 /run/user/1000/snap.pycharm-community
Alternatively you could set your environment variable XDG_RUNTIME_DIR
:
$ export XDG_RUNTIME_DIR=/your/dir
Source and more information on the topic
Upvotes: 9