微信扫一扫打赏支持
摘要: matplotlib画箭头 一、总结 一句话总结: ax.annotate("", xy=(1-0.1, 6), xytext=(1-0.1, 9),arrowprops=dict(arrowstyle="<->")) arrowstyle="<->" 表示双向箭头 二、matplotlib画箭头 阅读全文
posted @ 2020-11-10 23:49 范仁义 阅读(3865) 评论(0) 推荐(0) 编辑
摘要: matplotlib画图xticks设置为字母 一、总结 一句话总结: plt.xticks(np.arange(6), ('','t1', 't2', 't3', 't4', 't5')) 很多时候都可以去看帮助文档,里面介绍的非常详细 二、matplotlib画图xticks设置为字母 博客对应 阅读全文
posted @ 2020-11-10 23:02 范仁义 阅读(784) 评论(0) 推荐(0) 编辑
摘要: matplotlib画图的颜色及线条详解 一、总结 一句话总结: 有linestyle可选参数、marker可选参数、color可用的颜色 二、python中matplotlib的颜色及线条控制(转) 转自:python中matplotlib的颜色及线条控制https://www.cnblogs.c 阅读全文
posted @ 2020-11-10 20:38 范仁义 阅读(470) 评论(0) 推荐(0) 编辑
摘要: matplotlib去掉边框 一、总结 一句话总结: 去掉上边框:ax.spines['top'].set_visible(False) fig, ax = plt.subplots() # 取消边框 for key, spine in ax.spines.items(): # 'left', 'r 阅读全文
posted @ 2020-11-10 20:35 范仁义 阅读(1623) 评论(0) 推荐(0) 编辑
摘要: matplotlib库疑难问题 8、几个点画曲线 一、总结 一句话总结: 原理:几个点画曲线的原理和我们日常直接画曲线一样,就是在这几个点之间多造一些点,直接在x数据的最小值和最大值之间造一些x数据,然后用scipy.interpolate模块的 make_interp_spline函数造x对应的y 阅读全文
posted @ 2020-11-10 19:56 范仁义 阅读(466) 评论(0) 推荐(0) 编辑
摘要: matplotlib库疑难问题 7、去掉刻度和边框 一、总结 一句话总结: 去掉x轴刻度:将x轴的刻度置为空列表即可:plt.xticks([]) 去掉上边框:ax.spines['top'].set_visible(False) 二、matplotlib库去掉刻度和边框 博客对应课程的视频位置:7 阅读全文
posted @ 2020-11-10 19:11 范仁义 阅读(1825) 评论(0) 推荐(0) 编辑
摘要: matplotlib同时显示中文和特殊符号 一、总结 一句话总结: 直接分开写,加号连接即可 plt.text(0.1,6,r'x均值'+r'$:\mu_x$', fontdict={'size':16,'color':'r'}) 1、matplotlib中使用TeX标记? 你可以在任何 matpl 阅读全文
posted @ 2020-11-10 15:06 范仁义 阅读(4268) 评论(0) 推荐(0) 编辑
摘要: matplotlib指定线条的颜色以及标记 一、总结 一句话总结: color颜色 marker标记,markersize为标记大小 linestyle线样式,linewidth线宽 plt.plot(x,y,color='red', marker='o', linestyle='dashed',l 阅读全文
posted @ 2020-11-10 14:59 范仁义 阅读(201) 评论(0) 推荐(0) 编辑
摘要: from scipy.interpolate import spline报错ImportError: cannot import name ‘spline‘ 一、总结 一句话总结: 导入make_interp_spline而不是spline,spline这个函数现在没了 from scipy.int 阅读全文
posted @ 2020-11-10 14:28 范仁义 阅读(3164) 评论(0) 推荐(0) 编辑
摘要: matplotlib几个点画曲线 一、总结 一句话总结: 原理是引入scipy.interpolate的 make_interp_spline函数 在x的最小值和最大值中生成300个点 x_smooth = np.linspace(x.min(),x.max(),300) #300 represen 阅读全文
posted @ 2020-11-10 14:24 范仁义 阅读(594) 评论(0) 推荐(0) 编辑
摘要: 理解正态分布 一、总结 一句话总结: 让我们来看一个披萨外卖的例子。假设一家披萨餐厅的平均配送时间为30分钟,标准偏差为5分钟。【根据经验法则,我们可以确定68%的交付时间在25-35分钟(30 +/- 5)之间,95%在20-40分钟(30 +/- 2*5)之间,99.7%在15-45分钟(30 阅读全文
posted @ 2020-11-10 11:52 范仁义 阅读(4342) 评论(0) 推荐(0) 编辑