popgenmethods / smcpp

SMC++ infers population history from whole-genome sequence data.
GNU General Public License v3.0
149 stars 32 forks source link

how to use 'plot.py' to place the legend outside the top right corner of the plot frame or plot the resulting .json files in R? #224

Open yzliu01 opened 1 year ago

yzliu01 commented 1 year ago

Hi, I could not make appropriate changes in the plot.py so that I could place the legend outside the top right corner of the plot and better present the species names. Expected visualization like Example 2 on this page: https://www.statology.org/matplotlib-legend-position/, which seems to use different a module as in plot.py. Alternatively, when I try to plot the resulting .json files in R I got errors? Like: Error in fromJSON(file = "model.final.json") : not all data was parsed (576 chars were parsed out of a total of 1354 chars). Appreciate any advice. Thanks a lot.

tcztzy commented 9 months ago

You may use --csv to export the plotting points.

https://github.com/popgenmethods/smcpp/blob/8bdecdfa1064c930a620869a4ff53f21609b237c/smcpp/commands/plot.py#L31-L36