Feb-14-2022, 12:13 PM
Hey,
I'm plotting gradients of a surface. Most of them lay between 0 -1, but there are also a few from 1 - 700.
Right now im coloring gradients > 1 in matplotlib via the set_over function
actually it would be great not just to plot everything >1 in one colour, but plotting for example values between 1-100 green, 100-200 blue etc etc.
How can i achieve that?
I'm plotting gradients of a surface. Most of them lay between 0 -1, but there are also a few from 1 - 700.
Right now im coloring gradients > 1 in matplotlib via the set_over function
label_schriftgroesse = 20 schriftart = "Courier" fig, ax = plt.subplots(figsize=(30,15)) custom_cmap = copy.copy(cm.get_cmap("gray")) custom_cmap.set_over(color=[1,1,0]) plt.imshow(G_np, cmap = custom_cmap, origin="lower", vmax = 1, extent=[x_koordinaten_np[0],x_koordinaten_np[-1], # X-Werte y_koordinaten_np[0],y_koordinaten_np[-1]], # y-Werte interpolation='none') ax.set_xlabel('x [mm]', fontsize=label_schriftgroesse, fontname = schriftart) ax.set_ylabel('y [mm]', fontsize=label_schriftgroesse, fontname = schriftart) clb = plt.colorbar(extend = 'max') clb.set_label("z [mm]", fontsize=label_schriftgroesse, fontname = schriftart) plt.show()giving me the attached picture below.
actually it would be great not just to plot everything >1 in one colour, but plotting for example values between 1-100 green, 100-200 blue etc etc.
How can i achieve that?