Ответ от OP, отредактированный из их вопроса:
Решение Вот пример решения, основанного на ответе Аттерсона.Функция масштабирования была взята из этого ответа.
from matplotlib import pyplot as plt
def scale(val, src, dst):
"""
Scale the given value from the scale of src to the scale of dst.
"""
return ((val - src[0]) / (src[1]-src[0])) * (dst[1]-dst[0]) + dst[0]
# Actual data
data = [20, 50, 100, 250, 600, 200, 150, 100, 40, 30, 25, 20]
source_scale = (100, 600) # Scale values between 100 and 600
destination_scale = (100, 150) # to a scale between 100 and 150
# Apply scale to all items of data that are above or equal to 100
data_scaled = [x if x < 100 else scale(x, source_scale, destination_scale) for x in data]
# Set up a simple plot
fig = plt.figure()
ax = plt.Axes(fig, [0.,0.,1.,1.])
fig.add_axes(ax)
# Set the y-ticks to a custom scale
ax.set_yticks([0,20,40,60,80,100,110,120,130,140,150])
ax.set_ylim(0, 150)
# Set the labels to the actual values
ax.set_yticklabels(["0","20","40","60","80","100","200","300","400","500","600"])
ax.plot(data_scaled)