Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

set axis labels python

# Basic syntax:
plt.xlabel("X axis label") # Add ", fontsize = #" to control fontsize
plt.ylabel("Y axis label")

# Example usage:
plt.plot(range(5))
plt.xlabel("X axis label")
plt.ylabel("Y axis label")
plt.title("Figure title", fontsize = 20)

# Note, xlabel and ylabel come from matplotlib.pyplot and plt is an 
# 	abbreviation for this, e.g. import matplotlib.pyplot as plt
Comment

changing axis labels matplotlib

import matplotlib.pyplot as plt

fig, ax = plt.subplots()

labels = [item.get_text() for item in ax.get_xticklabels()]
labels[1] = 'Testing'

ax.set_xticklabels(labels)
Comment

python plot axis labels

ticks = [0, 1, 2]
labels = ["a", "b", "c"]

plt.figure()
plt.xticks(ticks, labels)
plt.show()
Comment

PREVIOUS NEXT
Code Example
Python :: The specified device is not open or is not recognized by MCI. 
Python :: convert list of strings to ints python 
Python :: python detect if tkinter page closed 
Python :: displaying flash message django 
Python :: add picture to jupyter notebook 
Python :: print traceback python 
Python :: python matplotlib log scale 
Python :: pytorch summary model 
Python :: convert python list to text file 
Python :: python list of random values 
Python :: Unable to locate package python-certbot-nginx 
Python :: pip.exe The system cannot find the file specified 
Python :: how to install mediapipe python 
Python :: export multiple python pandas dataframe to single excel file 
Python :: python decrease gap between subplot rows 
Python :: python strip non numeric in string 
Python :: ERROR: Failed building wheel for Pillow 
Python :: python: remove duplicate in a specific column 
Python :: pandas drop all columns except certain ones 
Python :: python get cpu cores 
Python :: df sort values 
Python :: python cli parameter 
Python :: change size of selenium window 
Python :: python current time 
Python :: discord.py ban 
Python :: create dict from json file python 
Python :: python split string by tab 
Python :: python filter array 
Python :: how to count docx pages python 
Python :: python - give a name to index column 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =