Keywordsdata visualization data visualization python data visualization python tutorial
1. Introduction to plotly
Plotly is a very famous and powerful open source
data visualization framework. It displays information by constructing interactive charts based on the web form displayed by the browser. It can create up to dozens of exquisite charts and maps.
Below we use jupyter notebook as a development tool for data analysis. Matplotlib has shortcomings such as not beautiful enough, static, and not easy to share, which limits the development of Python in data visualization. In order to solve this problem, a new type of
dynamic visualization open source module Plotly came into being.
Because Plotly is dynamic, beautiful, easy to use, and rich in variety.
It can be said that plotly is a top-level drawing method when drawing charts in Python.
We first look at the data visualization effect diagram through the official website of plotly. Here we have intercepted some of the effects and found that it is really powerful and supports online data/picture editing.
2. plotly two ways to draw charts
Plotly is a drawing system that integrates online drawing through menu operation and offline drawing through code. If you use the online method, you need to register a personal account on the official website and set a personal password when using plotly.
Online: Save your visual images to the website for easy sharing and storage.
Offline: directly generate visual images locally for easy use. (Recommended to use offline mode for easy viewing and reading)
import matplotlib.pyplot as plt
%matplotlib inline
import plotly
import plotly.graph_objs as go
from plotly.offline import init_notebook_mode,iplot
init_notebook_mode(connected=True)
import warnings
warnings.filterwarnings('ignore')
import numpy as np
import pandas as pd
plotly.__version__
Next we can draw a plotly program to see what the effect is
x = [1,2,3,4]
y = [10,15,13,17]
trace0 = go.Scatter(
x = x,
y = y
)
print(trace0)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.