栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

Data Visualization Libraries in Python

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Data Visualization Libraries in Python

For a Python data researcher, it turns out to be vital to learn data visualization libraries alongside the data science libraries. Here in this article, we will detail the best and broadly utilized Python data visualization libraries.

With the assistance of data visualization using python libraries, we can plot various kinds of charts to address data so everybody could comprehend the conduct of the data factors. Here is a brief glance into the 7 best Python data visualization libraries that we will cover in this article:

Matplotlib

Matplotlib is the most well-known and generally utilized python data visualization library and this would be your first data visualization library that you will learn with chipping away at data science with the Python programming language. Additionally, it is viable with Python data science libraries, as NumPy, learn, and pandas.

Strangely, Matplotlib was the principal Python data visualization library, and numerous different libraries are based on top of it. Besides, libraries like Seaborn and pandas utilize a portion of their strategies.

With Matplotlib, we can make intelligent 2D charts, including line diagrams, dissipate diagrams, structured presentations, and hist charts. In spite of the fact that Matplotlib doesn’t give inbuilt help for 3D charts, it gives an extra tool compartment — mplot3d — to plot 3D diagrams.

Beginning with Matplotlib

Matplotlib is an open-source outsider Python library, so we first need to introduce it prior to utilizing it.

pip install matplotlib

Example

>>> import matplotlib.pyplot as plt
>>> x = [1,2,3,4,5]
>>> y = [1,4,9,16,25]
>>> plt.plot(x,y)
[]
>>> plt.xlabel = "X axis"
>>> plt.ylabel = "Y axis"
>>> plt.show()

Plotly

It is an incredible and strong python data visualization library fit for plotting basic and complex diagrams. Utilizing this library, we can plot around 40 unique kinds of charts, including 2D and 3D.

Plotly is based on the highest point of the well-known Javascript library ploty.js, and it permits python designers to plot straightforward and intelligent charts on the internet browser. We can utilize this library to show charts on Jupyter Notebook and save those diagrams as independent HTML documents.

Starting with Plotly

Plotly is an open-source python library. Use the pip install command to install it.

Example

>>> import plotly.graph_objects as go
>>> fig = go.Figure(data=go.Bar(y=[2, 3, 1]))
>>> fig.show()

Bokeh

Like Plotly, Bokeh is another amazing Python data visualization library for current internet browsers. It is local to the Python programming language, and that is the reason numerous Python designers lean toward utilizing bokeh over Plotly.

Like plotly, we can acquire Bokeh plotted charts in HTML design. Bokeh is additionally entirely viable with famous python web systems, like Django and Flask, and we can install bokeh in Django and Flask web applications.

Starting with Bokeh

To use Bokeh, we first need to install it using the pip install command.

pip install bokeh

Example

>>> from bokeh.plotting import figure, show
>>> plot = figure(plot_width = 500, plot_height = 500)
>>> x = [10, 20, 30, 40]
>>> y= [100, 400, 900, 600]
>>> plot.circle(x,y)
>>> show(plot)

Ggplot

Python ggplot is a plotting library that depends on the R programming ggplot2 library. In ggplot, gg represents Grammar of graphs, and planning diagrams utilizing ggplot is like composing sentences in English. It is likewise entirely viable with the python pandas library and can plot diagrams utilizing Dataframes and Series.

Starting with ggplot

ggplot is an open-source library, so we can easily install it for our python environment using the pip install command.

pip install ggplot

Example

from ggplot import *
ggplot(aes(x='year', y='price'), data=price) +
    geom_line() +
    stat_smooth(colour='red', span=0.2)

Pygal

The data visualization library is utilized to plot straightforward diagrams on web applications. One can utilize this library with well-known python web systems, similar to Flask and Django, and plot dynamic and intuitive diagrams on the site page.

Pygal is fit for plotting various outlines, including line, bar, histogram, XY, pie, radar, box, and speck. Likewise, we can yield its diagram and charts in various configurations, including SVG, PNG, and Etree. The Python data visualization library is strongly suggested for little web applications that require basic and quick charts.

Starting with pygal

Install the pygal library using the pip command.

pip install pygal

Example

>>> import pygal
>>> line_chart = pygal.Line()
>>> line_chart.x_labels = map(str, range(2008, 2020))
>>> line_chart.add(Price,  [190, 200, 210, 215, 216, 220,  220,  221, 222, 230, 250])

>>> line_chart.render()
Folium 

The Folium library is based on top of the Javascript leaflet.js library. Regularly in data science, we work on projects where we need to imagine data on a guide. In such a situation, we can't depend on libraries like Matplotlib or seaborn. 

Here, we use libraries like Folium. The data visualization library is frequently utilized by data researchers during data cleaning of a guide. With the assistance of Folium, we can control map data and picture it in a hurry. 

Folium accompanies many underlying test sets for various guides, including OpenStreetMap, MapQuest open, Mapbox, and Stamen. Likewise, Folium upholds data in JSON arrangement and dilemmas that data to give visualization over a guide.

Conclusion

With this, we finish up our article on the best Python data visualization libraries. Data visualization is an unquestionable requirement to have the expertise of a Python data researcher. All the Python libraries that we have recorded here are the most famous ones and are positioned by their ubiquity and utilizations.

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/294009.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号