Use custom symbols with pslegend

Added by Engelbert about 1 year ago

I've created many custom symbols (e.g. diamonds.def http://pastebin.com/h2NwTtVX). They are all in the same directory like the script.

Of course I would like to have a legend explaining my custom symbols. I've tried to modify the example from http://gmt.soest.hawaii.edu/doc/latest/pslegend.html

##
G -0.1i
H 24 Times-Roman Legend
D 0.2i 1p
N 2
V 0 1p
Skdiamonds Diamonds
S diamonds Diamonds

but it doesn't worked.

Here is my script:

ps=minimal.ps
proj=L
bbox=-132/-61/24/60
center=-100/35/
parallels=33/45/
size=50
all="$proj$center$parallels$size"
pscoast -R$bbox -J$all -B+t"Industry" \
-Di -N1 -N2 \
-Gwheat -Slightblue \
-A2000 -K -Y2.75i > $ps
pslegend legend.txt -R$bbox -J$all -F+gazure1 -Dx0.5i/0.5i+w5i/3.3i+jBL+l1.2 \
-C0.1i/0.1i -B5f1 -O >> $ps
ps2pdf minimal.ps minimal.pdf
#mupdf minimal.pdf

QUESTION: How can I use custom symbols in the legend? Should I convert the custom symbols to EPS and embed them this way?

Thanks in advance!


Replies (2)

RE: Use custom symbols with pslegend - Added by Paul about 1 year ago

But your legend code looks nothing like the example on the pslegend man page? When I tried with a line like

S 0.1i kdiamond 0.25i - - 0.3i Custom diamond

it worked fine.

RE: Use custom symbols with pslegend - Added by Engelbert about 1 year ago

Thanks Paul, I was dumb.

So it behaves like this:
  • S = Symbol
  • 0.15i offset
  • custom symbol: diamonds
  • 0.15i offset
  • - - → without no legend!
  • 0.3i offset
  • Text

But what's the exact function of "- -"?

When my custom symbol is colored, it works fine, but what to do with one which needs to be stained?

With rohstoff.def =

0.5 0 M
0 0.5 D
-0.5 0 D
0 -0.5 D

None of the following lines works like I would expect it:

S 0.15i krohstoff 0.15i black - - 0.3i Coal
S 0.15i krohstoff black 0.15i - - 0.3i Coal
S 0.15i krohstoff 0.15i black 0.15i - - 0.3i Coal

(1-2/2)