picture of colorbar
I’m sure that the issue is caused by the fact that my x linspace doesn’t start from 0, since changing it to 0 fixes the problem (but breaks the plot). How can I fix this?
I changed the linspace to 0 and the colorbar worked fine but the plot is wrong
x = np.linspace(0.95 * min_area, 1.05 * self.max_area,resolution) #area
y = np.linspace(0,1.05 * self.max_score,resolution) #log rank
Z = [[None for _ in range(resolution)] for _ in range(resolution)]
for i in range(len(x)):
for j in range(len(y)):
Z[j][i] = self.get_pareto_fitness(y[j], x[i], True)
im = plt.imshow(Z, extent=[0.95 * min_area, 1.05*self.max_area, 0, 1.05*self.max_score], interpolation='nearest', origin='lower', cmap='magma', aspect='auto') #cmap='viridis' 'magma', alpha=0.6
cbar = plt.colorbar(im)
New contributor
Brian Ling is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.