My matplotlib (python)

Summary for myself Updated from time to time Describe the command you used and examined ** I just need to know myself, so the terms may be wrong in some places **

!! View

#command
    #Argument option description

Module loading

import matplotlib as mpl

Frequent operation

Instance of the figure

#Instance creation
fig = plt.figure()
    figsize=(x,y) #Specify vertical and horizontal sizes
    dpi= #image quality

#Create multiple maps
ax1 = fig.add_subplot()
    #First argument: line
    #Second argument: column
    #Third argument: location

bar graph

Grid lines, background color, etc. can be set with the same items as the histogram described later.

ax1.bar()
    #First argument: List of bar widths
    #Second argument: List of bar heights
    tick_label= #Label for each bar

histogram

The return value of the histogram is a little special and looks like the following ** n: X-axis data ** ** bins: Y-axis data ** ** paches: Objects for each bar **

n, bins, patches = ax1.hist()
    #The argument is an array of raw data
    bins=Number of sticks
    color= #Specify the color in the array

#Grid line
ax1.grid()
    color= #color

#X-axis label
ax1.set_xlabel()

#Y-axis label
ax1.set_ylabel()

#Back color
ax1.set_facecolor()

#title
ax1.title()

#Scale setting
ax1.set_xticks(np.arange(0,1300,250))
     #Arguments are minimum, maximum, and step

Recommended Posts

My matplotlib (python)
My Numpy (Python)
My pyproj (python)
My pandas (python)
My str (python)
My pyautogui (python)
#Python basics (#matplotlib)
My PySide (Python)
My urllib (python)
My pyperclip (python)
My sklearn (python)
[My memo] python
My ConfigParser (Python)
My Webdriver (Python)
My arcpy (python)
My win32gui (Python)
My os (python)
My python environment memo
My Beautiful Soup (Python)
[My memo] python -v / python -V
Heatmap with Python + matplotlib
Python Tips (my memo)
Installation of matplotlib (Python 3.3.2)
My python data analysis container
Python
Memorandum @ Python OR Seminar: matplotlib
My python data analytics environment
Python application: data visualization # 2: matplotlib
Create plot animation with Python + Matplotlib
A python graphing manual with Matplotlib.
Installation of SciPy and matplotlib (Python)
[Python] font family and font with matplotlib
[Python / matplotlib] Understand and use FuncAnimation
I made my own Python library
[Python] My stock price forecast [HFT]
My favorite boto3 (Python) API sample
Installation of Python, SciPy, matplotlib (Windows)
Heatmap with Dendrogram in Python + matplotlib
Python My Number verification module released
Draw Lyapunov Fractal with Python, matplotlib
When matplotlib doesn't work with python2.7
Lognormal probability plot with Python, matplotlib
[docker] python3.5 + numpy + matplotlib environment construction
The first step in Python Matplotlib
Matplotlib memorandum
kafka python
Display LaTeX notation formulas in Python, matplotlib
[Python] Extension using inheritance of matplotlib (NavigationToolbar2TK)
Python basics ⑤
python + lottery 6
Python Summary
Built-in python
Python comprehension
Studying python
[Python] Set the graph range with matplotlib
Python 2.7 Countdown
Python memorandum
Displaying candlestick charts in Python (matplotlib edition)
Python FlowFishMaster
Python service
python tips