matplotlib画图怎么确保横坐标和纵坐标的单位长度一致?

  统计/机器学习 数据可视化 Python    浏览次数:14435        分享
2

matplotlib画图怎么确保横坐标和纵坐标的单位长度一致?下面的图里面单位1的长度在x轴和y轴明显不一样。

怎么设置参数才能让x轴和y轴的单位度量一样长呢


 

沆瀣   2019-01-27 10:06



   1个回答 
4


plt.axis('equal')

或者

plt.axis('scaled')
SofaSofa数据科学社区DS面试题库 DS面经

何立诚   2019-01-30 00:57

谢谢,这个管用 - 沆瀣   2019-01-30 16:28


  相关讨论

matplotlib怎么把图例放到图外面

matpltlib怎么给直方图加上拟合曲线?

matplotlib.pyplot中怎么把legend放到图片外面去?

matplotlib画双y轴时,怎么隐藏右y轴的坐标网格线?

seaborn报错:regplot() got an unexpected keyword argument 'alpha'

matplotlib怎样让grid网格线处于图像下层?

matplotlib一个画板上多个图叠加,如何决定图层上下?

用plt.hist画直方图,怎么返回每个bins的上下界和个数?

plt.show()之后matplotlib图像依然不展示

python做图自定义背景色

  随便看看

K-means怎么选K?

随机梯度下降(sgd)的收敛问题

pandas DataFrame中经常出现SettingWithCopyWarning

pytorch里view(-1, 1)什么意思?

怎么理解surrogate loss function代理损失函数?