Proportional symbol map

Hi, I want to make a proportional symbol map like the election example from the wiki entry:

I think I can do this using psxy with -Sw following the example here:

But my question is how to prevent the pie charts from overlapping? Like in New England on the election figure? I want to use a connector line and alternate symbol location (like the -A option in psmeca), but psxy does not have this functionality in general, correct?

Any advice on how best to achieve this from the GMT gurus? So far, my searching hasn’t found any answers, thanks.

There is nothing in GMT to adjust locations of symbols depending on crowdedness on a map, so that would fall on you to do via scripting. If this is actually to make plots similarly to the one you mention (States etc) then presumably you will need to figure out once and for all what the best coordinates to use for this might be, and then stick with that. However, if it is different plots each time then there may be some work ahead.

There is a -D option to gmt plot to offset symbols, but it wouldn’t draw a line, and you would have to run plot seperately for each pie you wanted to move.

If I really wanted to avoid overlap I would

  1. run all the data through gmt plot -Sw (or psxy in classic mode)
    the data input could be:
    lng lat size start_angle end_angle
    with the fill colour set in the header
    (or set up a cpt and use -C[clr.cpt]
    lng lat zvalue size start_angle end_angle)
  2. visually identify the overlapping pies and choose alternative coordinates
  3. set up a multisegment data file to draw lines (using plot/psxy) from the old coordinates to the new.
  4. change the original coordinates in the piedata file to the alternates where necessary
  5. in the shell script draw the lines before drawing the pies

If I had lots of time to waste I might even play around with mapproject (and maybe gmtselect) to develop a nicely complicated algorithm to do it all programatically

But that example does not change the locations, which the polygon’s centroids, only the symbol size. And that can be done in GMT.

thanks all for the useful feedback