【发布时间】:2014-07-21 18:44:52
【问题描述】:
我想在 python 中绘制一个图并且只有刻度,我不想看到轴线,只有刻度。
我该怎么做?
matplotlib.版本 = 1.3.0
【问题讨论】:
标签: python matplotlib axes
我想在 python 中绘制一个图并且只有刻度,我不想看到轴线,只有刻度。
我该怎么做?
matplotlib.版本 = 1.3.0
【问题讨论】:
标签: python matplotlib axes
你可以使用
fig, ax = subplots()
ax.set_frame_on(False)
要了解蜱、刺等。请查看图库中的此条目:http://matplotlib.org/examples/ticks_and_spines/spines_demo_bounds.html
有很多功能可以改变这些元素的位置和外观。有关制作精美情节的更多信息,请查看 http://blog.olgabotvinnik.com/post/58941062205/prettyplotlib-painlessly-create-beautiful-matplotlib
【讨论】:
您可以尝试将轴的颜色设置为您的背景颜色。 假设白色:
for child in ax.get_children():
if isinstance(child, matplotlib.spines.Spine):
child.set_color('#FFFFFF')
【讨论】: