|
9 | 9 | parameter has to include the :math:`x`, :math:`y`, :math:`z` axis limits in the |
10 | 10 | form of (xmin, xmax, ymin, ymax, zmin, zmax), which can be done automatically |
11 | 11 | using :func:`pygmt.info`. To plot the z-axis frame, set ``frame`` as a |
12 | | -minimum to something like ``frame=["WsNeZ", "zaf"]``. Use ``perspective`` to |
| 12 | +minimum to something like ``Frame(axes="WsNeZ", zaxis=Axis(annot=True, tick=True))``. |
| 13 | +Use ``perspective`` to |
13 | 14 | control the azimuth and elevation angle of the view, and ``zscale`` to adjust |
14 | 15 | the vertical exaggeration factor. |
15 | 16 | """ |
16 | 17 |
|
17 | 18 | # %% |
18 | 19 | import pandas as pd |
19 | 20 | import pygmt |
| 21 | +from pygmt.params import Axis, Frame |
20 | 22 |
|
21 | 23 | # Load sample iris data |
22 | 24 | df = pd.read_csv("https://github.com/mwaskom/seaborn-data/raw/master/iris.csv") |
|
80 | 82 | # Set map dimensions (xmin, xmax, ymin, ymax, zmin, zmax) |
81 | 83 | region=region, |
82 | 84 | # Set frame parameters |
83 | | - frame=[ |
84 | | - "WsNeZ3+tIris flower data set", # z axis label positioned on 3rd corner, add title |
85 | | - "xafg+lPetal Width (cm)", |
86 | | - "yafg+lSepal Length (cm)", |
87 | | - "zafg+lPetal Length (cm)", |
88 | | - ], |
| 85 | + frame=Frame( |
| 86 | + axes="WsNeZ3", # z axis label positioned on 3rd corner |
| 87 | + title="Iris flower data set", |
| 88 | + xaxis=Axis(annot=True, tick=True, grid=True, label="Petal Width (cm)"), |
| 89 | + yaxis=Axis(annot=True, tick=True, grid=True, label="Sepal Length (cm)"), |
| 90 | + zaxis=Axis(annot=True, tick=True, grid=True, label="Petal Length (cm)"), |
| 91 | + ), |
89 | 92 | # Set perspective to azimuth NorthWest (315°), at elevation 25° |
90 | 93 | perspective=[315, 25], |
91 | 94 | # Vertical exaggeration factor |
|
0 commit comments