mapmixture icon indicating copy to clipboard operation
mapmixture copied to clipboard

overlapping pies

Open cgdmkns opened this issue 1 year ago • 2 comments

Dear Tom, Thanks for this package; it's convenient to use for great plots. I've successfully created a map with pie charts representing the STRUCTURE results of my data. However, the pie charts are overlapping due to the close proximity of my populations. Is there a way to plot these pie charts separately, with lines or arrows pointing to their exact coordinates using mapmixture? Thanks in advance, Cigdem

cgdmkns avatar Jun 21 '24 20:06 cgdmkns

Hi @cgdmkns,

To incorporate this is not trivial which is why the package does not currently support this. However, I am looking into how best to implement this programmatically in future versions.

It would be ideal to use ggrepel, but this package currently supports only text and label geoms. The pies in mapmixture are currently rendered on the map as annotation custom objects, because this allows users to easily project their maps to a different CRS without distortion of the pie charts.

Nevertheless, you could achieve your goal by (A) programming the pie chart positions manually, or (B) by plotting two maps where one is a zoomed-in map (you could then plot an inset map). If you provide your current code and a subset of your data, I could look into how you could approach option A.

Tom-Jenkins avatar Jun 25 '24 09:06 Tom-Jenkins

Thanks for the quick reply! I understand that adding this feature is complex. I'll try to plot different maps and zoom in on the locations of the populations, as you suggested as option B. By the way, I sent you an email including a subset of my data and code.

Best regards, Cigdem

cgdmkns avatar Jun 26 '24 13:06 cgdmkns