Compare commits
	
		
			2 Commits
		
	
	
		
			0c7108b3ec
			...
			2bfedf54ad
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						
						
							
						
						2bfedf54ad
	
				 | 
					
					
						|||
| 
						
						
							
						
						a9861a761f
	
				 | 
					
					
						
@@ -15,7 +15,8 @@ def getImageFilePath(imageIndex):
 | 
			
		||||
 | 
			
		||||
def getImageColorChannel(imageIndex, color):
 | 
			
		||||
    imageFilePath = getImageFilePath(imageIndex)
 | 
			
		||||
    return getColorChannel(imageFilePath, color)
 | 
			
		||||
    colorChannel = getColorChannel(imageFilePath, color)
 | 
			
		||||
    return colorChannel
 | 
			
		||||
 | 
			
		||||
def crop(image, interestingPosition, yRange, xRange):
 | 
			
		||||
    return image[interestingPosition[0] - yRange: interestingPosition[0] + yRange, interestingPosition[1] - xRange: interestingPosition[1] + xRange]
 | 
			
		||||
 
 | 
			
		||||
@@ -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()
 | 
			
		||||
		Reference in New Issue
	
	Block a user