ASCII Tables - Multiple Segment File Formatting

I am trying to use psxy and pstext (v6.0.0 - classic mode) and an ASCII table to plot two lines between three points. I am after three effects:

  1. The lines stop short of the points.
  2. Each point is labelled.
  3. A unique symbol is plotted over each point (eg unfilled triangle, filled triangle and circle).

psxy Table.txt -Wsize,white+o5p -R -J -K >>
pstext Table.txt -DJ0.05 -F+f+j -R -J -O >>

with Table.txt structured as follows:
x1 y1 Font_size,name,color1 Just1 Label1
x2 y2 Font_size,name,black Just2 Label2
x2 y2 Font_size,name,color2 Just2 Label2
x3 y3 Font_size,name,color3 Just3 Label3

gives me exactly what I am after for effects 1 (short lines) and 2 (labelling), but I am struggling to include the required symbol data into the table so I can plot each unique symbol and retain the correct labelling. The problem (as I see it) is that psxy expects the last column in the table to be the symbol data, but pstext takes everything after the Justification column to be the label data. Is it possible to structure the table to include both symbol and label data (if so how?) or will I need to create two tables, one for symbol data and one for labelling? I am hoping to be able to keep all the data in one table.

No, you cannot get away with one file for all this.
I am not sure what this is but other ideas are using psxy’s -W option modifiers for lines to not extend all the way to their start and end points, ad symbol -S~ decorated lines (lines with symbols along them).

Thanks for the reply Paul, it’s much appreciated.

As the saying goes: ‘A picture paints a thousand words.’ (That should be GMT’s motto!) So here’s what I am trying to achieve:

I’m using:
psxy … -Wpen+o5p …
to achieve the truncated lines. I’m guessing that’s what you are suggesting. I have no problem with labelling.

It’s just placing the symbols that’s my issue. Whilst easy enough to use separate invocations of psxy for each symbol in my example, my project will be scaled up to include tens, maybe hundreds, of lines with a dozen or more different symbols. Invoking individual psxy routines would be cumbersome. Hence my desire to include all the label and symbol information in one table. I’ve looked at the -S~ option to place the symbol formatting data in the segment headers, but each segment has two points (frequently with two different symbols), so -S~ doesn’t work in this case. As you have confirmed (and I feared) using one table isn’t possible.

I do have a workable solution using two Multiple Segment tables. Table 1 has the start and end point of each line (with justification and labels) in each segment. Table 2 has each point with symbol (-S) codes in each segment, with the pen (-W) and fill (-G) codes in the segment headers. I then invoke:

psxy Table1.txt -Wpen+o5p … to draw the lines
psxy Table2.txt -Wpen -S … to draw the symbols, and
pstext Table1.txt -F+fpen+j -D … to draw the labels.

I imagine an alternative for drawing the symbols might be to use psxy and -S~ and structure Table 2 to have all the symbol formatting codes (-S~) in the segment headers and only x,y data in the segments.

Thanks again Paul for your reply.

OK, I would then place all the symbols in one file and all lines in the other. Alternatively, to avoid forgetting to edit one but not the other file, have a single file in a custom format and then have the script split these into the two needed by GMT. E.g., using awk or similar. WIth -W…+o your line end points and symbol location coordinates should be the same so that simplifies matters.

Perfect, thank you…