Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plt
- import numpy as np
- num_colors = 10
- values = [x / 10.0 for x in range(5, (10*num_colors)+5, 10)] # [0.5, 1.5, ..., 9.5]
- # create example color-map (vertical strides)
- list = []
- for k in range(10*num_colors):
- tmp_list = []
- for i in range(len(values)):
- for j in range(10):
- tmp_list.append(values[i])
- list.append(tmp_list)
- Z = np.array(list)
- x = np.arange(0, num_colors, 0.1)
- y = np.arange(0, num_colors, 0.1)
- xx, yy = np.meshgrid(x, y)
- plt.contourf(xx, yy, Z, cmap='jet', alpha=1.0)
- plt.show()
- plt.contourf(xx, yy, Z, levels=10, cmap='jet', alpha=1.0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement