I am visualization multi-time series lines and want to show without axis. I have tried multiple solutions from google but could not successful.
Here is the code:
f = plt.figure(frameon=False)
f.set_figwidth(4)
f.set_figheight(1)
plt.plot(x, linewidth=1.5)
Here is the output of the above code:
Any idea how to turn off this box from the lines?
CodePudding user response:
for spine in plt.gca().spines.values():
spine.set_visible(False)
ax = plt.gca()
ax.axes.xaxis.set_visible(False)
ax.axes.yaxis.set_visible(False)
CodePudding user response:
Finally I fixed the code via getting help from
CodePudding user response:
Not a hundred percent sure what you mean by 'axis', but you can get rid of the frame by setting this:
plt.box(False)
So this is how it looks like: