Dynamic Visualization Drawing based on Plotly

Source: Internet
Author: User
Keywords data 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)


3. plotly drawing

Basic chart: 20 types
Statistics and shipping method chart: 12 kinds
Scientific charts: 21 types
Financial charts: 2 types
Map: 8 types
3D charts: 19 types
Report generation: 4 types
Connect to the database: 7 types
Fitting tools: 3 kinds
Flow chart: 4 types
JavaScript add custom control: 13 kinds


 



4. The first Python plotly, to get you started

 

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)
 
data = [trace0]
print(data)
 
iplot(data)

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.