Remove INTERESTING_VALUES_OF_AXES usage

This commit is contained in:
Benjamin Loison 2024-06-11 17:51:57 +02:00
parent a9861a761f
commit 2bfedf54ad
Signed by: Benjamin_Loison
SSH Key Fingerprint: SHA256:BtnEgYTlHdOg1u+RmYcDE0mnfz1rhv5dSbQ2gyxW8B8

View File

@ -31,11 +31,13 @@ for axis in Axis:
axisProfile = PROFILES_OF_AXES[axis]
colorsOfAxes[axis] = plt.plot(axisProfile, label = axis)[0].get_color()
'''
for axis in Axis:
for interestingValueOfAxisIndex, interestingValueOfAxis in enumerate(INTERESTING_VALUES_OF_AXES[axis]):
linestyle = ':' if interestingValueOfAxisIndex % 2 == 0 else '--'
label = f'{axis} local {"minimum" if interestingValueOfAxisIndex == 0 else "maximum"}' if interestingValueOfAxisIndex <= 1 else None
plt.axvline(interestingValueOfAxis, color = colorsOfAxes[axis], alpha = 0.3, linestyle = linestyle, label = label)
'''
def flattenDictValues(dict_):
return itertools.chain(*dict_.values())
@ -43,6 +45,7 @@ def flattenDictValues(dict_):
# TODO: How to avoid hardcoding the default color being `black`?
MATPLOTLIB_DEFAULT_COLOR = 'black'
'''
allInterestingValuesOfAxes = list(set(flattenDictValues(INTERESTING_VALUES_OF_AXES)))
ticks = list(plt.xticks()[0]) + allInterestingValuesOfAxes
plt.xticks(ticks)
@ -62,6 +65,7 @@ allInterestingIntensitiesOfAxes = list(flattenDictValues(INTERESTING_PROFILES_OF
allInterestingIntensitiesOfAxesMin = min(allInterestingIntensitiesOfAxes)
allInterestingIntensitiesOfAxesMax = max(allInterestingIntensitiesOfAxes)
plt.ylim(allInterestingIntensitiesOfAxesMin, allInterestingIntensitiesOfAxesMax)
'''
plt.legend()
plt.show()