나는 코드로 모든 설명을 추가 :
:
# Import the things you need
import numpy as np
import matplotlib.pyplot as plt
# Create a matplotlib figure
fig, ax = plt.subplots()
# Create values for the x axis from -pi to pi
x = np.linspace(-np.pi, np.pi, 100)
# Calculate the values on the y axis (just a raised sin function)
y = np.sin(x) + 1
# Plot it
ax.plot(x, y)
# Select the numeric values on the y-axis where you would
# you like your labels to be placed
ax.set_yticks([0, 0.5, 1, 1.5, 2])
# Set your label values (string). Number of label values
# sould be the same as the number of ticks you created in
# the previous step. See @nordev's comment
ax.set_yticklabels(['foo', 'bar', 'baz', 'boo', 'bam'])
그게 전부에요 ...
또는 당신은 단지 줄거리가 필요하지 않은 경우
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-np.pi, np.pi, 100)
y = np.sin(x) + 1
plt.plot(x, y)
plt.yticks([0, 0.5, 1, 1.5, 2], ['foo', 'bar', 'baz', 'boo', 'bam'])
이것은 sa를 수행하는 데 필요한 짧은 버전입니다. 당신이 그림과 하위 도표를 필요로하지 않는다면 저에게 해줄 수 있습니다.
http://stackoverflow.com/questions/15882249/matplotlib-aligning-y-ticks-to-the-left/15883858#15883858 – tacaswell
@tcaswell 적어도이 하나의 의미있는 제목이 있습니다 ... – joaquin
@joaquin 공정하다. 다른 하나의 제목을 의미있는 이름으로 편집했습니다. – tacaswell