|
6 | 6 | import matplotlib.cm as cm
|
7 | 7 |
|
8 | 8 | # Contour lines for each level are a list/tuple of polygons.
|
9 |
| -lines0 = [ [[0,0],[0,4]] ] |
10 |
| -lines1 = [ [[2,0],[1,2],[1,3]] ] |
11 |
| -lines2 = [ [[3,0],[3,2]], [[3,3],[3,4]] ] # Note two lines. |
| 9 | +lines0 = [[[0,0],[0,4]]] |
| 10 | +lines1 = [[[2,0],[1,2],[1,3]]] |
| 11 | +lines2 = [[[3,0],[3,2]], [[3,3],[3,4]]] # Note two lines. |
12 | 12 |
|
13 | 13 | # Filled contours between two levels are also a list/tuple of polygons.
|
14 | 14 | # Points can be ordered clockwise or anticlockwise.
|
15 |
| -filled01 = [ [[0,0],[0,4],[1,3],[1,2],[2,0]] ] |
16 |
| -filled12 = [ [[2,0],[3,0],[3,2],[1,3],[1,2]], # Note two polygons. |
17 |
| - [[1,4],[3,4],[3,3]] ] |
| 15 | +filled01 = [[[0,0],[0,4],[1,3],[1,2],[2,0]]] |
| 16 | +filled12 = [[[2,0],[3,0],[3,2],[1,3],[1,2]], # Note two polygons. |
| 17 | + [[1,4],[3,4],[3,3]]] |
18 | 18 |
|
19 | 19 |
|
20 | 20 | plt.figure()
|
|
38 | 38 | # Here a code type of 1 is a MOVETO, and 2 is a LINETO.
|
39 | 39 |
|
40 | 40 | plt.figure()
|
41 |
| -filled01 = [ [[0,0],[3,0],[3,3],[0,3],[1,1],[1,2],[2,2],[2,1]] ] |
42 |
| -kinds01 = [ [1,2,2,2,1,2,2,2] ] |
| 41 | +filled01 = [[[0,0],[3,0],[3,3],[0,3],[1,1],[1,2],[2,2],[2,1]]] |
| 42 | +kinds01 = [[1,2,2,2,1,2,2,2]] |
43 | 43 | cs = ContourSet(plt.gca(), [0,1], [filled01], [kinds01], filled=True)
|
44 | 44 | cbar = plt.colorbar(cs)
|
45 | 45 |
|
|
0 commit comments