Answers for "matplotlib axis labels"

5

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
Posted by: Guest on August-15-2020
6

matplotlib label axis

import matplotlib.pyplot as plt

plt.ylabel('Y AXIS')
plt.xlabel('X AXIS')
Posted by: Guest on April-17-2020
4

matplotlib axes labels

fig = plt.figure()
ax = fig.add_subplot(...)

ax.set_title('Title Here')

ax.set_xlabel('x label here')
ax.set_ylabel('y label here')
ax.set_zlabel('z label here')
Posted by: Guest on April-18-2020
0

matplotlib axis labels

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

plt.figure()
plt.xticks(ticks, labels)
plt.show()
Posted by: Guest on June-17-2021
-2

label axis matplotlib

ax2.set_xlabel('time (s)')
Posted by: Guest on April-02-2020

Code answers related to "matplotlib axis labels"

Python Answers by Framework

Browse Popular Code Answers by Language