Skip to content

Commit

Permalink
Commm
Browse files Browse the repository at this point in the history
  • Loading branch information
joa-quim committed Dec 20, 2024
1 parent e4dc2eb commit 56f13d0
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 20 deletions.
3 changes: 2 additions & 1 deletion _assets/common_opts/opt_pen.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- **W** or **pen**=`pen`\
Set pen attributes for the arrow stem [Defaults: width = default, color = black,
style = solid]. See \myreflink{Pen attributes}
style = solid]. See \myreflink{Pen attributes} and \myreflink{Vector attributes}
for arrow line terminations.
1 change: 0 additions & 1 deletion _layout/foot.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<!-- end custom footer snippets -->
<div class="page__footer-follow">
<ul class="social-icons">
<li><a href="https://twitter.com/gmt_dev" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-twitter-square" aria-hidden="true"></i> Twitter</a></li>
<li><a href="https://github.com/GenericMappingTools/GMT.jl" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-github" aria-hidden="true"></i> GitHub</a></li>
</ul>
</div>
Expand Down
3 changes: 1 addition & 2 deletions _layout/tag.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ <h1>Tag: {{fill fd_tag}}</h1>
<div class="page__footer-follow">
<ul class="social-icons">
<li><strong>Follow:</strong></li>
<li><a href="https://twitter.com/mmistakes" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-twitter-square" aria-hidden="true"></i> Twitter</a></li>
<li><a href="https://github.com/mmistakes" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-github" aria-hidden="true"></i> GitHub</a></li>
</ul>
</div>
Expand All @@ -41,4 +40,4 @@ <h1>Tag: {{fill fd_tag}}</h1>

</body>

</html>
</html>
4 changes: 3 additions & 1 deletion documentation/common_features/pens.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,7 @@ those guesses by using the `markersize`, `markecolor`, `markerline` options of t

In addition to these pen settings there are several PostScript settings that can affect the appearance of lines.
These are controlled via the GMT defaults settings `PS_LINE_CAP`, `PS_LINE_JOIN`, and `PS_MITER_LIMIT`.
See the end of the GMT CookBook section on [Specifying pen attributes](https://docs.generic-mapping-tools.org/latest/cookbook/features.html#specifying-pen-attributes)
See the end of the GMT CookBook section on [Specifying pen attributes](https://docs.generic-mapping-tools.org/latest/reference/features.html#specifying-pen-attributes)
for a visual display on the effect of changing these defaults.

Finaly, lines can be terminated with arrows, See \myreflink{Vector attributes}
2 changes: 1 addition & 1 deletion documentation/general/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ tuple-in-a-tuple because here we need also to specify the political boundary lev
So, in summary, a *pen* attribute may be set in three different ways:

1. With a text string that follows the *width*, *color*, *style* specs as explained in
[`Specifying pen attributes`](https://docs.generic-mapping-tools.org/latest/cookbook/features.html#wpen-attrib)
[`Specifying pen attributes`](https://docs.generic-mapping-tools.org/latest/reference/features.html#wpen-attrib)

2. By using the **lw** or **linewidth** keyword where its value is either a number, meaning the
line thickness in points, or a string like the *width* above; the color is set with the
Expand Down
2 changes: 1 addition & 1 deletion documentation/modules/coast.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ painted and no land fill is set then the land-areas will be transparent. A map p
to automatically select the best resolution given the chosen map scale.

- **E** or **DCW** : -- *DCW=code1,code2,...* **|** *DCW=(country=code, continent=code, pen=pen, fill=fill, file=fname, inside=true, outside=false, adjust_r=??, , adjust_R=??, , adjust_e=??, headers=false)*\
Select painting country polygons from the Digital Chart of the World. This is another dataset independent of GSHHG and hence the **area** and **resolution** options do not apply. **DCW="+l"** just list the countries and their codes [plotting takes place] and **DCW="+L"** shows states/territories for Argentina, Australia, Brazil, Canada, and the US. *country* or **name=code(s)**, where **code(s)** is a one or more comma-separated countries using the 2-character ISO 3166-1 alpha-2 convention. To select a state of a country (if available), append .state, e.g, US.TX for Texas. To specify a whole continent, use **continent=code**, with continent codes AF (Africa),AN (Antarctica), AS (Asia), EU (Europe), OC (Oceania), NA (North America), or SA (South America). Use **pen=pen** (see \myreflink{Pen attributes}) to draw polygon outlines and **fill=fill** (see \myreflink{Fill color/pattern}) to fill them [default is no fill]. At least one of these must be specified unless **dump** is in effect, in which case only one **DCW** option can be given. It is also possible to specify the parameters using simple Tuples. For example: **DCW=("PT", (0.5,"red","--"), "blue")** plots the polygon *PT* with a 0.5p red dashed line and filled with blue and **DCW=:PT** uses a default pen of 0.5. **DCW=(:PT, :blue)** fills with blue. You may repeat **DCW** to give different groups of items their own *pen/fill* settings. However, since we cannot repeat a keyword, the solution to setting different groupes is to use a tuple of tuples. An example would be *DCW=((country=:PT, pen=(2,:red), fill=:blue), (country=:ES, pen=(2,:blue)) )*. If neither **proj** nor **dump** are set then we just print the **region**. The **file=fname** is a new option in future GMT to let users select alternative DCW files. The **inside=true** (the default) means that data is ket _inside_ the clipping polygon. Use **outside=true** if want the reverse. **adjust_r=??** adjusts the region boundaries to be multiples of the steps indicated by _inc_ or _xinc/yinc_ or _winc/einc/sinc/ninc_. **adjust_R=??** adjusts the region boundaries adding the amounts specified by _inc_ or _xinc/yinc_ or _winc/einc/sinc/ninc_. **headers=true** place the country code in the segment headers via _-Zcode_ settings (for use with the **dump** option).
Select painting country polygons from the Digital Chart of the World. This is another dataset independent of GSHHG and hence the **area** and **resolution** options do not apply. **DCW="+l"** just list the countries and their codes [plotting takes place] and **DCW="+L"** shows states/territories for Argentina, Australia, Brazil, Canada, and the US. *country* or **name=code(s)**, where **code(s)** is a one or more comma-separated countries using the 2-character ISO 3166-1 alpha-2 convention. To select a state of a country (if available), append .state, e.g, US.TX for Texas. To specify a whole continent, use **continent=code**, with continent codes AF (Africa),AN (Antarctica), AS (Asia), EU (Europe), OC (Oceania), NA (North America), or SA (South America). Use **pen=pen** (see \myreflink{Pen attributes}) to draw polygon outlines and **fill=fill** (see \myreflink{Fill color/pattern}) to fill them [default is no fill]. At least one of these must be specified unless **dump** is in effect, in which case only one **DCW** option can be given. It is also possible to specify the parameters using simple Tuples. For example: **DCW=("PT", (0.5,"red","--"), "blue")** plots the polygon *PT* with a 0.5p red dashed line and filled with blue and **DCW=:PT** uses a default pen of 0.5. **DCW=(:PT, :blue)** fills with blue. You may repeat **DCW** to give different groups of items their own *pen/fill* settings. However, since we cannot repeat a keyword, the solution to setting different groupes is to use a tuple of tuples. An example would be *DCW=((country=:PT, pen=(2,:red), fill=:blue), (country=:ES, pen=(2,:blue)) )*. If neither **proj** nor **dump** are set then we just print the **region**. The **file=fname** is a option to let users select alternative DCW files. Available options by default are: *ODS*, *NE10m* or *NE110m*. For example: `DCW=(country=:CH, file=:ODS)` extracts the Swiss polygon from (small) `ODS.nc` file. The **inside=true** (the default) means that data is ket _inside_ the clipping polygon. Use **outside=true** if want the reverse. **adjust_r=??** adjusts the region boundaries to be multiples of the steps indicated by _inc_ or _xinc/yinc_ or _winc/einc/sinc/ninc_. **adjust_R=??** adjusts the region boundaries adding the amounts specified by _inc_ or _xinc/yinc_ or _winc/einc/sinc/ninc_. **headers=true** place the country code in the segment headers via _-Zcode_ settings (for use with the **dump** option).

- **getR** or **getregion** or **get_region** : -- *getR=code1,code2,...*\
Return the region corresponding to the code/list-of-codes passed in as argument. The code(s) are the same
Expand Down
6 changes: 3 additions & 3 deletions documentation/modules/grd2cpt.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ Optional Arguments
- **G** or **truncate** : -- *truncate=(zlo,zhi)*\
Truncate the incoming CPT so that the lowest and highest z-levels are to *zlo* and *zhi*. If one of these
equal NaN then we leave that end of the CPT alone. The truncation takes place before any resampling.
See also [Manipulating CPTs](https://docs.generic-mapping-tools.org/dev/cookbook/features.html#manipulating-cpts)
See also [Manipulating CPTs](https://docs.generic-mapping-tools.org/dev/reference/features.html#manipulating-cpts)

- **I** or **inverse** or **reverse** : -- *inverse=true* **|** *inverse=:z*\
Reverse the sense of color progression in the master CPT. Also exchanges the foreground and background colors,
including those specified by the parameters `COLOR_BACKGROUND` and `COLOR_FOREGROUND`. Use **inverse=:z** to
reverse the sign of z-values in the color table. Note that this change of *z*-direction happens before **truncate**
and **range** values are used so the latter much be compatible with the changed *z*-range. See also
[Manipulating CPTs](https://docs.generic-mapping-tools.org/dev/cookbook/features.html#manipulating-cpts)
[Manipulating CPTs](https://docs.generic-mapping-tools.org/dev/reference/features.html#manipulating-cpts)

- **L** or **datarange** or **clim** : -- *datarange=(minlimit, maxlimit)*\
Limit range of CPT to *(minlimit, maxlimit)*, and don't count data outside this range when
Expand Down Expand Up @@ -151,7 +151,7 @@ to the top, according to the prescribed new range. Hinges are either *hard* or
Soft hinges must be *activated* by appending **+h**[*hinge*] to the CPT name. If the
selected range does not include an activated soft or hard hinge then we only resample
colors from the half of the CPT that pertains to the range.
See [Of Colors and Color Legends](https://docs.generic-mapping-tools.org/dev/cookbook/cpts.html#of-colors-and-color-legends)
See [Of Colors and Color Legends](https://docs.generic-mapping-tools.org/dev/reference/cpts.html#of-colors-and-color-legends)
for more information.

Discrete versus Continuous CPT
Expand Down
2 changes: 1 addition & 1 deletion documentation/modules/grdedit.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Normally, **grdedit** will overwrite the existing grid with the modified grid.
Make necessary changes in the header to convert a gridline-registered grid to a pixel-registered grid,
or vice-versa. Basically, gridline-registered grids will have their domain extended by half the x- and
y-increments whereas pixel-registered grids will have their domain shrunk by the same amount. This is a
*non-destructive* grid change; see [Switching registrations](https://docs.generic-mapping-tools.org/latest/cookbook/options.html#switch-registrations).
*non-destructive* grid change; see [Switching registrations](https://docs.generic-mapping-tools.org/latest/reference/options.html#switch-registrations).

\textinput{common_opts/opt_V}

Expand Down
2 changes: 1 addition & 1 deletion documentation/modules/grdsample.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Optional Arguments
- **T** or **toggle** : *toggle=true*\
Translate between grid and pixel registration; if the input is grid-registered, the output will be
pixel-registered and vice-versa. This is a *destructive* grid change; see
[Switching registrations](https://docs.generic-mapping-tools.org/dev/cookbook/options.html#switch-registrations).
[Switching registrations](https://docs.generic-mapping-tools.org/dev/reference/options.html#switch-registrations).

\textinput{common_opts/opt_V}

Expand Down
2 changes: 1 addition & 1 deletion documentation/modules/inset.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Optional Arguments
- **F** or **box** : -- *box=(clearance=val, fill=color, inner=true, pen=pen, rounded=true, shaded=XX)*\
Without further options, draws a rectangular border around the map inset using `MAP_FRAME_PEN`. The following
modifiers can be appended to |-F|, with additional explanation and examples provided in the
[The background panel](https://docs.generic-mapping-tools.org/dev/cookbook/features.html#background-panel)
[The background panel](https://docs.generic-mapping-tools.org/dev/reference/features.html#background-panel)
cookbook section:

- **clearance=val** where *val* is either *gap* or *(xgap,ygap)*, or *(lgap,rgap,bgap,tgap)* where these items are uniform, separate in x- and y-direction, or individual side spacings between the map embellishment and the border for each side.
Expand Down
4 changes: 2 additions & 2 deletions documentation/modules/makecpt.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ Optional Arguments
- **G** or **truncate** : -- *truncate=(zlo,zhi)*\
Truncate the incoming CPT so that the lowest and highest z-levels are to *zlo* and *zhi*. If one of these
equal NaN then we leave that end of the CPT alone. The truncation takes place before any resampling.
See also [Manipulating CPTs](https://docs.generic-mapping-tools.org/dev/cookbook/features.html#manipulating-cpts)
See also [Manipulating CPTs](https://docs.generic-mapping-tools.org/dev/reference/features.html#manipulating-cpts)

- **I** or **inverse** or **reverse** : -- *inverse=true* **|** *inverse=:z*\
Reverse the sense of color progression in the master CPT. Also exchanges the foreground and background colors,
including those specified by the parameters `COLOR_BACKGROUND` and `COLOR_FOREGROUND`. Use **inverse=:z** to
reverse the sign of z-values in the color table. Note that this change of *z*-direction happens before **truncate**
and **range** values are used so the latter much be compatible with the changed *z*-range. See also
[Manipulating CPTs](https://docs.generic-mapping-tools.org/dev/cookbook/features.html#manipulating-cpts)
[Manipulating CPTs](https://docs.generic-mapping-tools.org/dev/reference/features.html#manipulating-cpts)

- **M** or **overrule_bg** : -- *overrule_bg=true*\
Overrule background, foreground, and NaN colors specified in the master CPT with the values of the parameters
Expand Down
6 changes: 3 additions & 3 deletions documentation/modules/plot.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ Parameters
Fills the plotting canvas with a backround image. That image may come from a file (*e.g.* **bg="cute.png"**) or
from a predefined function name. Possible names are: *akley, eggs, circle, parabola, rosenbrok, sombrero, x, y, xy, x+y* (see also \myreflink{Plot surfaces}). In the forms **bg=img** and **bg=grd**, the *img* and *grd* stand for a
\myreflink{Image type} and a \myreflink{Grid type} object respectively. Image types can have associated a color map
(if they do not see the \myreflink{image_cpt!} on how to assign one) but grid type do not so we need to provide that
(if they do not, see the \myreflink{image_cpt!} on how to assign one) but a grid type do not so we need to provide that
information in case the *turbo* default is not intended. To assign a colormap the **bg** argument must be a two elements
tuple, where first element is any of *funname|img|grd* and the second a colormap name (a CPT) or a \myreflink{CPT type}
object (see also \myreflink{makecpt}). To revert the sense of the color progression prefix the colormap name or of
the predefined function with a '-'. Example: `plot(rand(8,2), bg=(:sombrero, "-magma"))`. Note that the images,
either generated or read from file, will normally be deformed to fill the entire area selected with the **region**
option. If that is not wished or if the image coordinates are intended to be used than this is not the right
option. If that is not wished or if the image coordinates are intended to be used, then this is not the right
option but instead you should \myreflink{grdimage} followed plot call(s). Another point to notice is that the
\myreflink{frame} option also has a *fill* or *bg|background* option that also fills the canvas but it does it using
a constant color by replicating a pattern (that can be an image too) and this has a quite different result.
Expand Down Expand Up @@ -153,7 +153,7 @@ Parameters
- **decorated** i.e., lines with symbols along them. See \myreflink{Decorated lines}

- **csymbol** or **cmarker** or **custom_symbol** or **custom_marker** : -- *csymbol=(name=symbname, size=val, unit=unity)*\
Use one the GMT's [custom symbols](https://docs.generic-mapping-tools.org/dev/cookbook/custom-symbols.html#custom-symbols)
Use one the GMT's [custom symbols](https://docs.generic-mapping-tools.org/dev/reference/custom-symbols.html#custom-symbols)
where *symbname* is the lowercase name of any of those in the table, plus `arrow` or `ski_alpine` (these are from GMT.jl).

- **W** or **pen=pen**\
Expand Down
2 changes: 1 addition & 1 deletion documentation/utilities/gmtread.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Specify data type (with *type*=true, e.g. `img=true`). Choose among:

If file is an image `layer` can be a 1 or a 1x3 array (to read a RGB image). Not that in this later case
bands do not need to be contiguous. A `band=[1,5,2]` composes an RGB out of those bands. See more at
[Modifiers for COARDS-compliant netCDF files](https://docs.generic-mapping-tools.org/latest/cookbook/features.html#modifiers-for-cf)
[Modifiers for COARDS-compliant netCDF files](https://docs.generic-mapping-tools.org/latest/reference/features.html#modifiers-for-cf)
but note that we use **1 based** indexing here.

Use ``layers=:all`` to read all levels of a 3D cube netCDF file.
Expand Down
40 changes: 40 additions & 0 deletions examples/arrows/10_arrows.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,46 @@ showfig()
```
\end{examplefig}

## Cartesian, circular, and geographic vectors

Plot Cartesian, circular, and geographic vectors. This [example](https://www.pygmt.org/dev/gallery/lines/vector_styles.html)
was picked from the PyGMT gallery.

\begin{examplefig}{}
```julia
using GMT
coast(region=[-127, -64, 24, 53], proj=:merc, borders=1, area=4000, shore=true)

# Left: plot 12 Cartesian vectors with different lengths
x = fill(-116, 12); # x vector coordinates
y = linspace(33.5, 42.5, 12); # y vector coordinates
direction = zeros(12); # direction of vectors (horizontal)
length = linspace(0.5, 2.4, 12); # length of vectors
arrows!([x y direction length], pen=(1,:red),
paper=true, arrow=(len="0.2", stop=true, fill=:red, angle=40, shape=:triang))
text!(text="CARTESIAN", x=-112, y=44.2, font="13p,Helvetica-Bold,red")

# Middle: plot 7 math angle arcs with different radii
num = 7
x, y = fill(-95, 7), fill(37, 7)
radius = 1.8 .- 0.2 * (0:num-1)
startdir = fill(90, num)
stopdir = 180 .+ 40 * (0:num-1)
data = [x y radius startdir stopdir]
plot!(data, marker=(matang=true, arrow=(length=0.5, stop=true)), fill=:red3, pen="1.5,black")
text!(text="CIRCULAR", x=-95, y=44.2, font="13p,Helvetica-Bold,black")

# Right: plot geographic vectors using endpoints
NYC = [-74.0060 40.7128]
CHI = [-87.6298 41.8781]
SEA = [-122.3321 47.6062]
NO = [-90.0715 29.9511]
plot!([NYC CHI; NYC SEA; NYC NO], pen="1.0,blue",
geovec=(length=0.5, stop=true, endpoint=true, fill=:blue, angle=30, pen="1p,blue"))
text!(text="GEOGRAPHIC", x=-74.5, y=44.2, font="13p,Helvetica-Bold,blue", show=1)
```
\end{examplefig}

## Quivers

A (nicer looking) Matlab quiver plot example. To fully reproduce the Matlab example we also use the extremely
Expand Down
2 changes: 1 addition & 1 deletion examples/art/art_examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ lines([-0.7 -0.25 0], [-1.5 -0.8 0], # The flower stem
limits=(-1,1,-1.5,1), # Fig limits
lw=9, # Stem's line width in points
lc=:darkgreen, # Stem's line color
bezier=true, # Smooth the stem polyne as a Bezier curve
bezier=true, # Smooth the stem polyline as a Bezier curve
figsize=(14,0), # Fig size. Second arg = 0 means compute the height keeping aspect ratio
frame=:none) # Do not plot the frame
plot!(x, y,
Expand Down

0 comments on commit 56f13d0

Please sign in to comment.