Skip to content

Commit faa6fa7

Browse files
committed
apply scope
1 parent 8d965f7 commit faa6fa7

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

docs/src/tutorials/plottingmaps.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,27 +113,27 @@ GLMakie.activate!()
113113

114114
let's continue using the cmip6 dataset
115115

116-
````@example plots
116+
````@example AoG
117117
store ="gs://cmip6/CMIP6/ScenarioMIP/DKRZ/MPI-ESM1-2-HR/ssp585/r1i1p1f1/3hr/tas/gn/v20190710/"
118118
g = open_dataset(zopen(store, consolidated=true))
119119
c = g["tas"]
120120
````
121121

122122
and let's focus on the first time step:
123123

124-
````@example plots
124+
````@example AoG
125125
dim_data = readcubedata(c[time=1]) # read into memory first!
126126
````
127127

128128
and now plot
129129

130-
````@example plots
130+
````@example AoG
131131
data(dim_data) * mapping(:lon, :lat; color=:value) * visual(Scatter) |> draw
132132
````
133133

134134
set other attributes
135135

136-
````@example plots
136+
````@example AoG
137137
plt = data(dim_data) * mapping(:lon, :lat; color=:value)
138138
draw(plt * visual(Scatter, marker=:rect), scales(Color = (; colormap = :plasma));
139139
axis = (width = 600, height = 400, limits=(0, 360, -90, 90)))
@@ -143,26 +143,33 @@ draw(plt * visual(Scatter, marker=:rect), scales(Color = (; colormap = :plasma))
143143

144144
For this let's consider more time steps from our dataset:
145145

146-
````@example plots
146+
````@example AoG
147147
using Dates
148148
dim_time = c[time=DateTime("2015-01-01") .. DateTime("2015-01-01T21:00:00")] # subset 7 t steps
149149
````
150150

151-
````@example plots
151+
````@example AoG
152152
dim_time = readcubedata(dim_time); # read into memory first!
153153
nothing # hide
154154
````
155155

156-
````@example plots
156+
````@example AoG
157157
plt = data(dim_time) * mapping(:lon, :lat; color = :value, layout = :time => nonnumeric)
158158
draw(plt * visual(Scatter, marker=:rect))
159159
````
160160

161161
again, let's add some additional attributes
162162

163-
````@example plots
163+
````@example AoG
164164
plt = data(dim_time) * mapping(:lon, :lat; color = :value, layout = :time => nonnumeric)
165165
draw(plt * visual(Scatter, marker=:rect), scales(Color = (; colormap = :magma));
166166
axis = (; limits=(0, 360, -90, 90)),
167167
figure=(; size=(900,600)))
168+
````
169+
170+
most [Makie plot functions](https://docs.makie.org/stable/reference/plots/overview) should work. See `lines` for example
171+
172+
````@example AoG
173+
plt = data(dim_data[lon=1..10]) * mapping(:lat, :value; layout = :lon => nonnumeric)
174+
draw(plt * visual(Lines); figure=(; size=(600,400)))
168175
````

0 commit comments

Comments
 (0)