corner.py icon indicating copy to clipboard operation
corner.py copied to clipboard

multiple sets of points

Open davidwhogg opened this issue 10 years ago • 5 comments

I have K sets of points, each of which is a large number N_k of objects in D dimensions. I want to plot these all on the same corner plot in different colors. How do I do that? I am happy to write the patch.

davidwhogg avatar Jan 10 '16 22:01 davidwhogg

This is possible. You can use a combination of the color and fig kwargs.

fig = corner.corner(samps1, color="k")
corner.corner(samps2, color="g", fig=fig)

dfm avatar Jan 10 '16 23:01 dfm

You are absolutely right. Sorry to waste issue space.

(I'm closing but I should open a pull request to the tutorial...)

davidwhogg avatar Jan 11 '16 19:01 davidwhogg

I am reopening this. Here is my code (100000 data points, 16 centers) I want to plot the centers as red dots on top of blue data. This doesn't work (I get red one-d histograms but no red points on the blue plots), and if I do the other order I also don't see the red points. What am I doing wrong? Full code checked in at Platypus.

        figure = corner.corner(data, range=ranges, labels=labels, color="b",
                               bins=128, plot_datapoints=True, plot_density=True, plot_contours=True)
        corner.corner(centers, range=ranges, color="r", fig=figure,
                      plot_datapoints=True, plot_density=False, plot_contours=False)
        fn = "{}/centers.{}".format(dir, suffix)
        figure.savefig(fn)

davidwhogg avatar Jan 12 '16 02:01 davidwhogg

ps. python3.5 pps. a zorder keyword might be all I am missing...?

davidwhogg avatar Jan 12 '16 02:01 davidwhogg

Can you post a figure showing your issue? You might need to use something like data_kwargs=dict(ms=10) for the red plot.

dfm avatar Jan 12 '16 05:01 dfm