matplotlib axis arrow tip

后端 未结 5 2081
执念已碎
执念已碎 2020-12-14 18:23

I am trying to set an arrow at the end of a an axis in matplotlib. I don\'t want to remove the spines and replace them with pure arrows because I need their functionalities

5条回答
  •  旧巷少年郎
    2020-12-14 18:50

    In order to obtain what you want, Julien's answer is enough after deleting the following section from the arrowed_spines function:

    # removing the default axis on all sides:
    for side in ['bottom','right','top','left']:
        ax.spines[side].set_visible(False)
    
    # removing the axis ticks
    plt.xticks([]) # labels 
    plt.yticks([])
    ax.xaxis.set_ticks_position('none') # tick markers
    ax.yaxis.set_ticks_position('none')
    

    Spines can still be modified after the inclusion of arrows, as you can see here:

提交回复
热议问题