python有几种可视化图形库?
python有几种可视化图形库?
对于编程的印象,很多人还是停留在程序代码上。其实我们早就可以运用代码,绘制出我们想要的数据图片,然后更多的应用于数据分析中。目前python可视化图库已经发展的非常全面,其中的种类也比较多,这里给大家分享一些常用的图形库,同时带来散点图的代码示例练习。
一、可视化图形库
1.seaborn是基于matplotlib的高级版,主要针对的数据挖掘和机器学习的变量特征选取,可以用非常短小的代码就可以画出多维变量的可视化图形。
2.plotly同时支持Python和R语言,并且实现了在线导入数据做可视化并保存内容在云端server的功能。做演示的时候,只需要在本地的jupyternotebook与plotlyserver建立通信,即可调用已经做好的可视化内容做展示。
3.pyecharts是基于百度echarts的一个开源项目,也是我经常使用的交互可视化的工具,相比bokeh和plotly,pyecharts的语法更简单,实现效果更佳出众。
4.bokeh是python中一款基于网页的画图工具库,可以用于网站的可视化展示,具有交互性。
二、可视化图形代码
散点图
importnumpyasnp
importpandasaspd
importmatplotlib.pyplotasplt
importseabornassns
#数据准备
N=1000
x=np.random.randn(N)
y=np.random.randn(N)
#用Matplotlib画散点图
plt.scatter(x,y,marker='x')
plt.show()
#用Seaborn画散点图
df=pd.DataFrame({'x':x,'y':y})
sns.jointplot(x="x",y="y",data=df,kind='scatter');
plt.show()
以上就是python教程中python的可视化图形库介绍,大家在了解了这些基础的图形库后,就可以进行对应的下载。已经安装好的小伙伴,就可以开始画散点图了。更多Python学习教程请关注IT培训机构:千锋教育。

相关推荐HOT
更多>>
python函数标注是什么
python函数标注是什么在参数的使用方法中,还有一种解包的情况是需要我们掌握的。比如,将列表或者字典的值转换为函数的参数,就需要用到参数解...详情>>
2023-11-14 14:13:35
python正负索引的使用
python正负索引的使用本文教程操作环境:windows7系统、Python3.9.1,DELLG3电脑。1、说明使用正索引(从左至右)、负索引(从右至左)访问元素,时...详情>>
2023-11-14 13:45:04
python垃圾回收的机制过程
python垃圾回收的机制过程本文教程操作环境:windows7系统、Python3.9.1,DELLG3电脑。1、步骤(1)收集所有容器对象(list,dict,tuple,customClas...详情>>
2023-11-14 13:05:15
pythontry语句的执行原理
pythontry语句的执行原理1、原理分析(1)执行try子句(try和except关键字之间的多行语句)。(2)如果没有异常发生,则跳过except子句并完成try语句...详情>>
2023-11-14 09:37:35热门推荐
技术干货






