Skip to content

Commit

Permalink
Ups
Browse files Browse the repository at this point in the history
  • Loading branch information
joa-quim committed May 10, 2023
1 parent eca45a2 commit b3b238a
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion _libs/lunr/lunr_index.js

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions documentation/modules/colorbar.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,19 @@ Mercator map produced by a previous call, ensuring a 2 cm offset from the map fr
```julia
colorbar!(region=(0,10,0,10), pos=(justify=:CT, width=10, offset=(0,2), horizontal=true), cmap="colors.cpt", show=1)
```

Show automatic placement of color bars when selecting a side mid-point.

```julia
C = makecpt(cmap=:jet, range=(0,100));
basemap(region=(0,30,0,45), frame=(axes=:wsne, annot=:auto, ticks=:auto))
colorbar!(position=(inside=true, anchor=:BC), xaxis=(annot=:auto, ticks=:auto),
box=(pen=(0.25,:red),), ylabel="@.C", cmap=C)
colorbar!(position=(outside=true, anchor=:BC), box=(pen=(0.25,:red),), ylabel="@.C", cmap=C)
colorbar!(position=(inside=true, anchor=:TC), box=(pen=(0.25,:red),), ylabel="@.C", cmap=C)
colorbar!(position=(outside=true, anchor=:TC), box=(pen=(0.25,:red),), ylabel="@.C", cmap=C)
colorbar!(position=(inside=true, anchor=:ML), box=(pen=(0.25,:red),), ylabel="@.C", cmap=C)
colorbar!(position=(outside=true, anchor=:ML), box=(pen=(0.25,:red),), ylabel="@.C", cmap=C)
colorbar!(position=(inside=true, anchor=:MR), box=(pen=(0.25,:red),), ylabel="@.C", cmap=C)
colorbar!(position=(anchor=:MR,), box=(pen=(0.25,:red),), ylabel="@.C", cmap=C, show=true)
```
6 changes: 4 additions & 2 deletions documentation/modules/plot.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,10 @@ Parameters
Add a legend to the plot. In its simple form just provide `legend="thelabel"`, which plots the legend at the
default *UpperRight* position. To control the legend position and other parameters one must use the tuple form
where `label="thelabel"` is the same as above; `pos=position` where *position* is a 2 char code (or its expanded form)
like in the \myreflink{text}. The `box` option may take two forms (refer to \myreflink{legend} for more details):
(1) use `box=:none` to not plot the legend box or, (2) `box=(clearance=?, fill=?, inner=?, pen=?, rounded=?, shade=?)`.
like in the \myreflink{text}. For a full featured positioning option in `legend=(label="thelabel", pos=(...))` see the
`pos` option in \myreflink{legend} that allows also to plot the legend outside of the figure space. The `box` option
may take two forms (refer to \myreflink{legend} for more details): (1) use `box=:none` to not plot the legend box or,
(2) `box=(clearance=?, fill=?, inner=?, pen=?, rounded=?, shade=?)`.
For example, `box=(pen=1, fill="gray95", shade=true)` to plot a light gray box with a shade. When using the
**groupvar** option we can just set `legend=true` to create a legend containing an entry for each of the groups.
Controling the position of that legend is done by omitting the *label* keyword in the `legend=(...)` form.
Expand Down
6 changes: 6 additions & 0 deletions documentation/utilfuns.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ append2fig
blendimg!
cart2pol
cart2sph
coastlinesproj
colorzones!
cpt4dcw
crop
Expand All @@ -13,6 +14,7 @@ gadm
geodetic2enu
getbyattrib
gmtread
graticules
gunique
hlines
imagesc
Expand All @@ -30,6 +32,7 @@ mat2ds
mat2grid
mat2img
pcolor
plotgrid!
plotyy
pol2cart
polygonlevels
Expand All @@ -45,9 +48,12 @@ theme
triplot
uniqueind
vecangles
viz
vlines
wmsinfo
wmsread
wmstest
worldrectangular
worldrectgrid
xyzw2cube
yeardecimal
2 changes: 1 addition & 1 deletion examples/legends/01_legends.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ gmtbegin()
plot("@Table_5_11.txt", marker=:circle, markersize=0.35, markercolor="lightgreen",
markerline="faint", legend="Apples")
plot("@Table_5_11.txt", marker=:triangle, ms=0.35, fill="orange", legend="Oranges")
legend(position=(inside=:TR, width=3, offset=0.25), box=(pen=1, fill="gray95", shaded=true))
legend(position=(anchor=:TR, width=3, offset=0.25), box=(pen=1, fill="gray95", shaded=true))
gmtend(:show)
```
\end{examplefig}
Expand Down
2 changes: 1 addition & 1 deletion utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function env_examplefig(com, _)
getpath4docs(file::String) = joinpath("..", "..", "..", "..", "..", file) # hide
$code
end # hide
mv(joinpath(tempdir(), "GMTjl_tmp.png"), joinpath(@OUTPUT, "$pngfile"), force=true); # hide
mv(joinpath(tempdir(), "GMTjl_" * GMT.tmpdir_usr[2] * ".png"), joinpath(@OUTPUT, "$pngfile"), force=true); # hide
GMT.isFranklin[1] = false # hide
GMT.IamModern[1] = false # hide
Expand Down

0 comments on commit b3b238a

Please sign in to comment.