How I can get cartesian coordinate system in matplotlib?

后端 未结 5 760
悲哀的现实
悲哀的现实 2020-12-03 07:11

I am new to plotting with Python and can\'t really find an answer to the question: How can I get Cartesian coordinate plane in matplotlib? By this I mean perpendicular refe

5条回答
  •  既然无缘
    2020-12-03 08:06

    This is an old question, but I think with today's matplotlib versions, the keyword is spines. You would do:

    ax = plt.gca()
    ax.spines['top'].set_color('none')
    ax.spines['bottom'].set_position('zero')
    ax.spines['left'].set_position('zero')
    ax.spines['right'].set_color('none')
    

    The link provides more examples.

提交回复
热议问题