[PYTHON] When the axis and label overlap in matplotlib

Introduction

スクリーンショット 2020-04-18 8.15.15.png

The axis and label overlap A man born just to do matplotlib

solution

ax.set_ylabel("cost", rotation=270, labelpad=15)

The above rotation is irrelevant (usually I use it because I want the right-facing label "cost" to be reversed).

By specifying the labelpad, you can specify the distance from the figure.

With this, we were able to widen the width as shown below.

スクリーンショット 2020-04-18 8.17.28.png

site

Recommended Posts

When the axis and label overlap in matplotlib
[Matplotlib] Do not tilt the axis label
Put the second axis in 2dhistgram of matplotlib
When the node disappears in rqt_graph
The first step in Python Matplotlib
Precautions when drawing the probability density function and the histogram on top of each other in matplotlib
Specify the color in the matplotlib 2D map
Behavior when returning in the with block
When the target is Ubuntu 16.04 in Ansible
Separation of design and data in matplotlib
Find it in the procession and edit it
When the previous graph remains in Seaborn
The date is displayed incorrectly in matplotlib.
[pandas] When specifying the default Index label in the at method, "" is not required
[Python] Precautions when retrieving data by scraping and putting it in the list
Add PATH when installing Anaconda3 in the terminal Change shell and hide (base)
Change the device (drive) label in vfat format.
12. Save the first column in col1.txt and the second column in col2.txt
When I try matplotlib in Python, it says'cairo.Context'
About the difference between "==" and "is" in python
Precautions when installing packages in the conda environment
matplotlib: Replace the axis itself with another one.
I checked the reference speed when using python list, dictionary, and set type in.
Put Scipy + Matplotlib in Ubuntu on Vagrant and display the graph with X11 Forwarding
What to do when only the window is displayed and nothing is displayed in pygame Note
I created a stacked bar graph with matplotlib in Python and added a data label
In matplotlib, set the vertical axis on the left side of the histogram to frequency and the vertical axis on the right side to relative frequency (maybe a wicked way)
The simplest Python memo in Japan (classes and objects)
Investigate the relationship between TensorFlow and Keras in transition
When the selected object in bpy.context.selected_objects is not returned
Extract and list personal names and place names in the text
Receive the form in Python and do various things
Initial settings when using the foursquare API in python
Omit the decimal point of the graph scale in matplotlib
Carefully understand the exponential distribution and draw in Python
Read the csv file and display it in the browser
Plot and understand the multivariate normal distribution in Python
Carefully understand the Poisson distribution and draw in Python
Embedding in datetime when only the time is known
Select the required variables in TensorFlow and save / restore
Find the Hermitian matrix and its eigenvalues in Python
Automatically access the flow in enebular and pull the trigger
When I tried to install PIL and matplotlib in a virtualenv environment, I was addicted to it.
Check the argument type annotation when executing a function in Python and make an error
[Python] When you want to import and use your own package in the upper directory