![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
matplotlib
mohana48833985
这个作者很懒,什么都没留下…
展开
-
matplotlib 趋势图 折线图 插入图片
matplotlib 趋势图 折线图 插入图片原创 2023-03-15 16:57:28 · 328 阅读 · 0 评论 -
plt.legend 调整顺序 倒序 handles
plt.legend 调整顺序 倒序 handles原创 2023-03-14 16:52:28 · 1152 阅读 · 0 评论 -
plt.legend 显示不完整 不完全 超出图片
plt.legend 显示不完整 不完全 超出图片原创 2023-03-14 16:32:27 · 841 阅读 · 0 评论 -
plot.bar plot.label_bar 添加文本标签 不要循环 柱状图添加标签 柱状图添加文字标签 plt.text
plot.bar plot.label_bar 添加文本标签 不要循环原创 2023-03-14 11:22:46 · 467 阅读 · 0 评论 -
python 将多个参数传给子函数 **kargs **keywords
python 将多个参数传给子函数 **kargs **keywords原创 2023-02-22 09:39:05 · 130 阅读 · 0 评论 -
Excel worksheet name ‘‘ must be <= 31 chars.
Excel worksheet name '' must be原创 2023-02-21 17:09:42 · 416 阅读 · 0 评论 -
plt.legend 图例放在外面 子图会挤在一起 子图压缩 压扁
plt.legend 图例放在外面 子图会挤在一起 子图压缩 压扁原创 2023-02-21 14:11:42 · 661 阅读 · 0 评论 -
matplotlib 平滑曲线 绘制圆滑曲线 光滑曲线 折线图 插值法 scip
matplotlib 平滑曲线 绘制圆滑曲线 光滑曲线 折线图 插值法 scip原创 2023-02-17 11:37:13 · 1039 阅读 · 0 评论 -
matplotlib 保留刻度 不显示 ticks
matplotlib 保留刻度 不显示 ticks原创 2023-02-17 11:34:54 · 313 阅读 · 0 评论 -
matplotlib ax 怎么控制 rotation ax.set_xticks rotation df.plot rotation
matplotlib ax 怎么控制 rotation ax.set_xticks rotation原创 2023-02-17 09:48:20 · 484 阅读 · 0 评论 -
dataframe 堆积图 堆积折线图 stacked=True 堆积条形图 plt.barh plt.bar 堆积柱状图 参数详解
dataframe 堆积图 堆积折现图 stacked=True原创 2023-02-16 11:47:43 · 487 阅读 · 0 评论 -
matplotlib fig.legend 多子图图例覆盖问题 子图图例怎么调整 图例放外面
matplotlib fig.legend 多子图图例覆盖问题 子图图例怎么调整 图例放外面原创 2023-02-16 10:41:16 · 1336 阅读 · 0 评论 -
matplotlib不要科学计数法 plt.ticklabel_format(style=‘plain‘)
【代码】matplotlib不要科学计数法 plt.ticklabel_format(style='plain')原创 2022-10-31 18:21:25 · 1851 阅读 · 0 评论 -
dataframe 绘制相关系数拟合线 散点图拟合线
https://blog.csdn.net/weixin_42395998/article/details/123414317转载 2022-07-19 14:45:35 · 388 阅读 · 0 评论 -
dataframe matplotlib 日期坐标轴变密集、坐标轴百分比格式(更改坐标轴格式)
dataframe matplotlib 日期坐标轴变密集、坐标轴百分比格式(更改坐标轴格式)原创 2022-07-08 15:38:45 · 842 阅读 · 0 评论 -
matplotlib 改变时间刻度间隔 改变时间刻度格式
目录减小间隔改变时间刻度的格式原来的图:想把x轴的坐标间隔变小想把x轴坐标显示为 时:分 如:20:00import matplotlib.dates as mdatefig1 = plt.figure(figsize=(15,5))ax = fig1.add_subplot(1,1,1)ax.xaxis.set_major_formatter(mdate.DateFormatter('%H:%M'))#设置时间标签显示格式a = dmS.resample(on='sendTime'原创 2021-04-26 09:59:17 · 11137 阅读 · 0 评论 -
python 绘制旭日图
参考链接:https://blog.csdn.net/m0_67790374/article/details/124137448源数据:jupyter无法显示图像:https://blog.csdn.net/Caiqiudan/article/details/125117824转载 2022-06-04 00:40:32 · 873 阅读 · 1 评论 -
plotly不显示图形
pyplot 不显示图形转载 2022-06-04 00:29:04 · 1913 阅读 · 1 评论 -
df.plot dataframe 子图布局 自定义子图布局 layout参数
df.plot(layout=(3,1))原创 2022-05-27 12:11:41 · 410 阅读 · 0 评论 -
dataframe df.plot secondary_y 双y轴
df.plot(secondary_y='列名')原创 2022-05-25 16:19:24 · 1131 阅读 · 0 评论 -
dataframe python pyecharts 桑葚图
links = [{'source': 'Italy', 'target': '18岁以下', 'value': '1677'}, {'source': '18岁以下', 'target': 'Deceased', 'value': '167'}, {'source': '18岁以下', 'target': 'Active/Recovered', 'value': '1510'}, {'source': 'Italy', 'target': '19-50岁', 'value': '31394'},转载 2022-05-25 11:38:52 · 469 阅读 · 0 评论 -
线上jupyter 的matplotlib无法显示中文问题(已解决)
问题描述:线上jupyter无法显示中文。配置了下面这行代码也不行plt.rcParams['font.sans-serif'] = ['Simhei'] # 黑体原因:不存在Simhei或其他中文字体难点:通过jupyter控制服务器解决办法:下载字体simhei.ttf本地的电脑有这个字体,在路径C:\Windows\Fonts下将字体上传到服务器可以利用jupyter的上传功能上传了文件:3. 找到matplotlib存放font的路径from matplotlib原创 2022-05-23 17:21:41 · 2988 阅读 · 2 评论 -
python 绘制漏斗图
a = '搜索'fig = go.Figure(go.Funnel( y = ["Website visit", "Downloads", "Potential customers", "Requested price", "invoice sent"], x = [39, 27.4, 20.6, 11, 2] textposition = "inside", textinfo = "value+percent initial", opacity = 0.65)原创 2022-05-10 15:03:03 · 1298 阅读 · 0 评论 -
dataframe groupby plot 分组绘图 先分组,再绘图
adv.hist(column=‘咨询次数’, by=‘周次’)原创 2022-05-05 12:34:42 · 1927 阅读 · 0 评论 -
matplotlib 双y轴 双坐标轴 plt.twinx()
plt.twinx() 或者 axis.twinx()原创 2022-03-16 14:41:22 · 2075 阅读 · 0 评论 -
python matplotlib绘制箭头 plt.annotate
plt.annotate用法和ax.annotate一样,参照:Matplotlib中annotate详解plt.plot([0,40], [0,40])plt.annotate('aaaaaaaaaaaaaaaa', xy=(6, 40), xytext=(1,1), arrowprops=dict(arrowstyle="->", color="r", hatch='*',))原创 2022-03-07 09:25:37 · 4513 阅读 · 0 评论 -
matplotlib plt.hist 绘制密度/概率直方图
方法一参数density=1方法二直接修改yticksplt.yticks(plt.yticks()[0], np.round(np.array(plt.yticks()[0])/len(ap_train), 2));ap_train['REGION_POPULATION_RELATIVE'].hist(bins=30)plt.legend()plt.xlabel='人口密度'plt.yticks(plt.yticks()[0], np.round(np.array(plt.yticks原创 2022-01-09 18:20:36 · 1612 阅读 · 0 评论 -
matplotlib plt.barh 调整条形宽度
参数height=0.5原创 2021-12-30 20:44:41 · 2387 阅读 · 0 评论 -
matplotlib plt.title把标题放图片下方 参数y=-0.2
plt.title('title', y=-0.2)https://blog.csdn.net/Strive_For_Future/article/details/119936383转载 2021-10-23 17:37:16 · 1035 阅读 · 0 评论 -
matplotlib plt.bar设置 热力颜色 颜色渐变条 颜色随数值大小变化 多维图 三维
def draw_bar(key_name, key_values): ''' 绘制带渐变颜色的柱状图,附带渐变条 parameters: key_names:柱状图的横轴名称 key_values:柱状图的纵轴数值 return: 返回一张图 ''' norm = plt.Normalize(key_values.min(), key_values.max()) norm_values = norm(原创 2021-10-21 20:28:16 · 5356 阅读 · 3 评论 -
python箱线图/直方图柱子线条边界有颜色 加入参数 histtype=‘barstacked‘
plt.hist(pensioner,edgecolor='w') # 参数edgecolor原创 2020-07-31 17:09:17 · 3550 阅读 · 0 评论 -
python matplotlib searbon 设置画版颜色 热力图固定颜色等级 固定比例尺寸大小
参数vmax、vmincmap 设置颜色等级,参考:https://blog.csdn.net/pary__for/article/details/104971632sns.heatmap(globals()['c%s'%(year-2010)], cmap='jet', vmax=5000) # cmap='jet'这里只设置了vmax 根据需要还可以设置vmin原创 2021-01-18 23:21:51 · 3450 阅读 · 3 评论 -
matplotlib画紧密的聚集在一起的DataFrame散点图
features = data[['RM', 'PTRATIO', 'LSTAT ']]pd.plotting.scatter_matrix(features, alpha=0.7, figsize=(6,6), diagonal='hist')转载 2021-07-09 10:42:18 · 737 阅读 · 0 评论 -
sns.jointplot画联合分布图 直方图+散点图,设置xy轴标签
ax = sns.jointplot(x=bo.x13,y=bo.x1)ax.set_axis_labels('低社会地位人口的比例(%)', '人均犯罪率')或者ax = sns.jointplot(x='x13', y='x1', data=bo)ax.set_axis_labels('低社会地位人口的比例(%)', '人均犯罪率')原创 2021-07-08 11:09:52 · 2505 阅读 · 0 评论 -
matplotlib 雷达图
# 雷达图 二级分类 def draw_polar(col='二级分类', n=8): a = od.groupby(['门店名称', col]).单项数量.sum().unstack(level=0).fillna(0) a['共计'] = a.agg(sum, axis=1); a = a/a.sum() # 以共计排序 a = a.sort_values('共计', ascending=False).iloc[:n] ax1= plt.subplot(1原创 2021-07-07 14:08:32 · 377 阅读 · 0 评论