matplotlib- 数据可视化

这篇博客详细介绍了matplotlib库在数据可视化中的应用,包括安装步骤、图标制作技巧,如折线图、散点图的创建,以及颜色、轮廓和颜色映射的自定义方法。还探讨了在使用过程中遇到的问题和解决方案,如删除数据点轮廓、理解'c'参数和颜色映射的使用,最后讲解了如何自动保存图表。
摘要由CSDN通过智能技术生成

matplotlib- 数据可视化

1. 安装

step1:安装matplotlib

pip install matplotlib

Note: you may need to restart the kernel to use updated packages.

step2:更新(有待确定)

conda upgrade notebook
conda upgrade jupyter

`
step3:测试

import matplotlib

若无错误提示,即认为安装正确

2. 图标的制作

  • 2.1折线图
import matplotlib.pyplot as plt  #导入pyplot模块
square = [ 1, 4, 9, 16, 25 ]     #平方函数
plt.plot (square)                #plot()画图
plt.show()                       #plt.show()图片查看

这里是引用

  • 修改标签和线条加粗
 plt.plot(squares, linewidth = 5)    #改变线条粗读

plt.title('square numbers' , fontsize = 24)     #设置标题
plt. xlabel('value', fontsize = 14)             #设置x轴
plt.ylabel('square of value' , fontsize = 14)   #设置y轴
plt.tick_params(axis = 'both', labelsize =14)   #设置刻度大小

  • 7
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值