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

PREVIOUS NEXT
Code Example
Python :: python open file 
Python :: is flask open source 
Python :: Installing packages from requirements.txt file 
Python :: python regex get string before character 
Python :: check tf verison 
Python :: case insensitive replace python 
Python :: how to change background of tkinter window 
Python :: isprime python 
Python :: move file python 
Python :: make binary tree in python 
Python :: unable to get local issuer certificate python 
Python :: smtpauthenticationerror 
Python :: measure execution time in jupyter notebook 
Python :: serial clear buffer python 
Python :: pandas difference between dates 
Python :: stock market api python 
Python :: opencv export image 
Python :: pause python 
Python :: pyspark join 
Python :: cool things to do with python 
Python :: iterate through attributes of class python 
Python :: python find all elements of substring in string 
Python :: int object is not subscriptable in python 
Python :: compile python to pyc 
Python :: sys.path[0] 
Python :: how to reboot a python script 
Python :: pytesseract.image_to_string save text file 
Python :: switching keys and values in a dictionary in python [duplicate] 
Python :: convert index of a pandas dataframe into a column 
Python :: get guild by id discord.py 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =