Skip to content

Commit 55686b7

Browse files
committed
test
1 parent 1403386 commit 55686b7

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
if plot:
2+
block__ = ids_block[grid.dense_grid_slice]
3+
4+
# Define specific levels for the four categories: <1, 1-2, 3-4, >4
5+
levels = [float('-inf'), 1.0, 2.0, 3.0, 4.0, float('inf')]
6+
7+
# Use a colormap with distinct colors for the categories
8+
# You can choose a different colormap like 'viridis', 'tab10', 'Set1', etc.
9+
cmap = plt.cm.get_cmap('autumn', 4) # 4 distinct colors
10+
11+
contour = plt.contourf(block__.reshape(50, 5, 50)[:, 0, :].T,
12+
levels=levels,
13+
cmap=cmap,
14+
extent=(.25, .75, .25, .75))
15+
16+
xyz = interpolation_input.surface_points.sp_coords
17+
plt.plot(xyz[:, 0], xyz[:, 2], "o")
18+
19+
# Create a colorbar with custom ticks and labels
20+
cbar = plt.colorbar(ticks=[0.5, 1.5, 2.5, 3.5])
21+
cbar.ax.set_yticklabels(['< 1', '1-2', '3-4', '> 4']) # Custom labels
22+
23+
plt.show()

0 commit comments

Comments
 (0)