[PYTHON] Omit the decimal point of the graph scale in matplotlib

demo

Before (decimal display) After (integer display)
dec.png int.png

Method

Change Locator to 1.

from matplotlib.ticker import *
ax = plt.gca()
ax.yaxis.set_major_locator(MultipleLocator(1))	#yaxis for x-axis-> xaxis

reference

matplotlib - memoring http://seesaawiki.jp/met-python/d/matplotlib#content_9_31_4

Recommended Posts

Omit the decimal point of the graph scale in matplotlib
Calculation result after the decimal point in Python
Increase the font size of the graph with matplotlib
Change the decimal point of logging from, to.
Put the second axis in 2dhistgram of matplotlib
The basis of graph theory with matplotlib animation
Paste a link to the data point of the graph created by jupyterlab & matplotlib
Display n digits after the decimal point in python
Show decimal point in Python
Change the style of matplotlib
Connected components of the graph
Have the equation graph of the linear function drawn in Python
The story of participating in AtCoder
Change the Y-axis scale of Matplotlib to exponential notation (10 Nth power notation)
[TensorFlow 2] How to check the contents of Tensor in graph mode
Draw retention rate graph in Matplotlib
The story of the "hole" in the file
The meaning of ".object" in Django
Unravel the mystery of matplotlib specgram
About the size of matplotlib points
The first step in Python Matplotlib
I want to change the color by clicking the scatter point in matplotlib
Graph of the history of the number of layers of deep learning and the change in accuracy
Check the in-memory bytes of a floating point number float in Python
Graph the change in the number of keyword appearances per month using pandas
Read the graph image with OpenCV and get the coordinates of the final point of the graph
You can see the transition of points in the J League on the graph!
I tried to display the altitude value of DTM in a graph
[Understanding in 3 minutes] The beginning of Linux
[Python] Set the graph range with matplotlib
Specify the color in the matplotlib 2D map
Check the behavior of destructor in Python
[pyqtgraph] Set the size ratio of the graph
Summary of frequently used commands in matplotlib
Align the size of the colorbar with matplotlib
Omit BOM from the beginning of the string
Display Matplotlib xy graph in PySimple GUI.
The result of installing python in Anaconda
Let's claim the possibility of pyenv-virtualenv in 2021
Display the graph of tensorBoard on jupyter
The basics of running NoxPlayer in Python
Separation of design and data in matplotlib
In search of the fastest FizzBuzz in Python
When the previous graph remains in Seaborn
The date is displayed incorrectly in matplotlib.
Use libsixel to output Sixel in Python and output a Matplotlib graph to the terminal.
Output the number of CPU cores in Python
Draw a graph of a quadratic function in Python
The meaning of {version-number} in the mysql rpm package
[Python] Sort the list of pathlib.Path in natural sort
About the X-axis notation of Matplotlib bar graphs
[Python] limit axis of 3D graph with Matplotlib
Change the font size of the legend in df.plot
Match the distribution of each group in Python
View the result of geometry processing in Python
Make a copy of the list in Python
One liner that lists the colors of matplotlib
Find the number of days in a month
Read the output of subprocess.Popen in real time
Find the divisor of the value entered in python
The story of finding the optimal n in N fist