|
51 | 51 | # You can force all the contours to be the same color. |
52 | 52 |
|
53 | 53 | fig, ax = plt.subplots() |
54 | | -CS = ax.contour(X, Y, Z, 6, |
55 | | - colors='k', # negative contours will be dashed by default |
56 | | - ) |
| 54 | +CS = ax.contour(X, Y, Z, 6, colors='k') # Negative contours default to dashed. |
57 | 55 | ax.clabel(CS, fontsize=9, inline=1) |
58 | 56 | ax.set_title('Single color - negative contours dashed') |
59 | 57 |
|
|
62 | 60 |
|
63 | 61 | matplotlib.rcParams['contour.negative_linestyle'] = 'solid' |
64 | 62 | fig, ax = plt.subplots() |
65 | | -CS = ax.contour(X, Y, Z, 6, |
66 | | - colors='k', # negative contours will be dashed by default |
67 | | - ) |
| 63 | +CS = ax.contour(X, Y, Z, 6, colors='k') # Negative contours default to dashed. |
68 | 64 | ax.clabel(CS, fontsize=9, inline=1) |
69 | 65 | ax.set_title('Single color - negative contours solid') |
70 | 66 |
|
|
74 | 70 |
|
75 | 71 | fig, ax = plt.subplots() |
76 | 72 | CS = ax.contour(X, Y, Z, 6, |
77 | | - linewidths=np.arange(.5, 4, .5), |
78 | | - colors=('r', 'green', 'blue', (1, 1, 0), '#afeeee', '0.5') |
79 | | - ) |
| 73 | + linewidths=np.arange(.5, 4, .5), |
| 74 | + colors=('r', 'green', 'blue', (1, 1, 0), '#afeeee', '0.5'), |
| 75 | + ) |
80 | 76 | ax.clabel(CS, fontsize=9, inline=1) |
81 | 77 | ax.set_title('Crazy lines') |
82 | 78 |
|
|
0 commit comments