|
21 | 21 |
|
22 | 22 | # %% |
23 | 23 | import pygmt |
24 | | -from pygmt.params import Axis |
| 24 | +from pygmt.params import Axis, Frame |
25 | 25 |
|
26 | 26 | fig = pygmt.Figure() |
27 | 27 |
|
|
39 | 39 | pen = "1.5p" |
40 | 40 | with fig.set_panel(panel=0): |
41 | 41 | fill = "skyblue" |
42 | | - fig.basemap(region=[0, 4, 0, 3], frame="+tvertical bars") |
| 42 | + fig.basemap(region=[0, 4, 0, 3], frame=Frame(title="vertical bars")) |
43 | 43 | fig.plot(x=1, y=2, style="b0.5c", fill=fill, pen=pen) |
44 | 44 | fig.plot(x=2, y=2.5, style="b1c", fill=fill, pen=pen) |
45 | 45 | # +b1 means that the bar is starting from y=1 here |
46 | 46 | fig.plot(x=3, y=2.5, style="b0.75c+b1", fill=fill, pen=pen) |
47 | 47 |
|
48 | 48 | with fig.set_panel(panel=1): |
49 | 49 | fill = "tomato" |
50 | | - fig.basemap(region=[0, 4, 0, 3], frame="+thorizontal bars") |
| 50 | + fig.basemap(region=[0, 4, 0, 3], frame=Frame(title="horizontal bars")) |
51 | 51 | fig.plot(x=1.5, y=0.5, style="B0.75c", fill=fill, pen=pen) |
52 | 52 | fig.plot(x=3, y=1.5, style="B1c", fill=fill, pen=pen) |
53 | 53 | # +b2 means that the bar is starting from x=2 here |
|
63 | 63 | } |
64 | 64 |
|
65 | 65 | with fig.set_panel(panel=2): |
66 | | - fig.basemap(region=[0, 4, 0, 3], frame="+tstacked bars") |
| 66 | + fig.basemap(region=[0, 4, 0, 3], frame=Frame(title="stacked bars")) |
67 | 67 | fig.plot(data=data, style="B0.75c+i4", cmap=True, pen=pen) |
68 | 68 |
|
69 | 69 | with fig.set_panel(panel=3): |
70 | | - fig.basemap(region=[0, 4, 0, 3], frame="+tsplit bars") |
| 70 | + fig.basemap(region=[0, 4, 0, 3], frame=Frame(title="split bars")) |
71 | 71 | fig.plot(data=data, style="B1c+v4+s", cmap=True, pen=pen) |
72 | 72 |
|
73 | 73 | fig.show() |
0 commit comments