I’m trying to get plot -S~ to work. I’m struggling on how to pass desired the symbol. According to the documentation for -S~
+s<symbol><size>
Specifies the code and size of the decorative symbol.
I was unable to find anything on what the +s option expects exactly. I assumed it to be similar to -Sk and tried
-S~d30p:+striangle10p
without luck:
plot [WARNING]: riangle10 not a valid number and may not be decoded properly.
That lead me to assume that only the first character after the +s is parsed as symbol. Trying
-S~d30p:+st10p
didn’t throw an error but plotted only the line. No symbols to be seen. Another try was the custom symbol syntax:
-S~d30p:+sktriangle/10p
which didn’t work as well and I get some warnings and a line:
plot [WARNING]: triangle/10 not a valid number and may not be decoded properly.
plot [WARNING]: triangle/10 not a valid number and may not be decoded properly.
plot [WARNING]: triangle/10 not a valid number and may not be decoded properly.
plot [WARNING]: triangle/10 not a valid number and may not be decoded properly.
plot [WARNING]: triangle/10 not a valid number and may not be decoded properly.
plot [WARNING]: triangle/10 not a valid number and may not be decoded properly.
plot [WARNING]: triangle/10 not a valid number and may not be decoded properly.
plot [WARNING]: triangle/10 not a valid number and may not be decoded properly.
plot [WARNING]: triangle/10 not a valid number and may not be decoded properly.
plot [WARNING]: triangle/10 not a valid number and may not be decoded properly.
plot [WARNING]: triangle/10 not a valid number and may not be decoded properly.
plot [WARNING]: triangle/10 not a valid number and may not be decoded properly.
plot [ERROR]: Unrecognized symbol code (107 = 'k') passed to gmt_draw_custom_symbol
I get the feeling I’m missing something. Can somebody please nudge me in the right direction on the proper usage of -S~?
Here is the code I’m experimenting with:
cat > path1.txt << END
1.5 0.9
0.5 1.8
-0.5 1.6
-1.5 0.9
END
gmt begin symbol_line
gmt basemap -R-2/2/-2/2 -JM6i -Bafg1
gmt plot path1.txt -S~d30p:+sktriangle/10p -W1p,black
gmt end show
Thank you @pwessel for the hint. I found my problem – by default no pen or fill is used on the symbol.
A pen and/or fill must be defined otherwise the symbol won’t be shown. I have expected that it is plotted with default values for pen and fill similar to -Sf and others.
-S~d30p:+st10p+gred
~~~~~
works. But I have two questions:
Why is the symbol angled? According to the docs default should be line parallel? The result doesn’t look line parallel to me. Maybe I’m not understanding it correctly.
Any way to use custom symbols? Unleash the power of custom symbols … on lines!
@pwessel if you are not sure why custom symbols would be beneficial have a look at nautical charts or NOAA Chart No 1 Part N. They have a great variety of different lines with symbols (anchors, ducks, divers, fishes, etc). I tried to build two easier ones with the given possibilities so you get an idea:
Am trying to find a more adaptative solution… and so far nothing worked.
I’m trying to find a way to generate vector parameters from the coordinates similar to
at p0 : lon0 lat0 az(p0:p1) dist(p0:p1)
at p1 : lon1 lat1 az(p1:p2) dist(p1:p2)
...
with eventually the possibility to have dist(pN:pN+1) being a fraction of the actual distance then interpolate extra points in-between.
But I couldn’t find a more elegant solution than doing it on Matlab.
If Cartesian then you get Cartesian angle I think… Inot (you get Cartesian azimuth) then for -Sv you would need to use -i on that column to add 90 and scale by -1