Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
70 views
in Technique[技术] by (71.8m points)

python - How to move labels from graph in matplotlib?

I am trying to move those labels from the graph (like Finance Info, Network Info) which are mixed into that graph. also, I want to add 0 in the center as a label.

graph

labels = df1.columns
stats = df1.loc[0, labels].values
angles = np.linspace(0, 2 * np.pi, len(labels), endpoint=False)  # Set the angle
# close the plot
stats = np.concatenate((stats, [stats[0]]))
angles = np.concatenate((angles, [angles[0]]))

fig2 = plt.figure(figsize=(6, 5))
ax = fig2.add_subplot(111,projection='polar')  # Set polar axis
ax.plot(angles, stats, 'o-', linewidth=1,color='#b1282e')
ax.fill(angles, stats, alpha=0.70,color='#b1282e')  # Fulfill the area

ax.set_thetagrids(angles * 180 / np.pi, labels)  # Set the label for each axis
ax.grid(True)
plt.show()
question from:https://stackoverflow.com/questions/65849305/how-to-move-labels-from-graph-in-matplotlib

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...