Python data analysis—Pandas visualization

Series.plot main parameters and usage instructions

parameter illustrate
label Labels for charts
style Style string, such as 'g - -
alpha The fill opacity of the image (0, 1)
kind Image type (bar, line, hist, kde, etc.)
xticks Set the X-axis scale value
yticks Set Y-axis scale value
xlim,ult Set axis limits
grid Show axis gridlines
rot Rotate tick labels
use_index Use the object's index as tick labels
logy Use a logarithmic scale on the Y-axis

The main parameters of DataFrame.plot and their descriptions

parameter illustrate
subplot Plot each DataFrame column into a separate subplot
sharex,sharey Share X,Y axis
title image caption
legend Add legend, displayed by default
sort_colunms Plots columns in alphabetical order, using the current order by default

Import module

import numpy as np
import pandas as pd
import matplotlib.pyplot as plot

1: Linear graph

Linear tables are generally used to describe trends between two sets of data.

Single curve:

s = pd.Series(np.random.normal(size = 50))
s.plot()

Insert image description here
Multiple curves:

df = pd.DataFrame({
    
    'one':np.random.normal(size = 20),
                   'two':np.random.normal(size = 20),
                  'three':np.random.normal(size = 20)})
df.plot()

Insert image description here

Guess you like

Origin blog.csdn.net/qq_52331221/article/details/127467544