Generate a heatmap in MatPlotLib using a scatter data set

后端 未结 12 2138
南方客
南方客 2020-11-22 09:22

I have a set of X,Y data points (about 10k) that are easy to plot as a scatter plot but that I would like to represent as a heatmap.

I looked through the examples in

12条回答
  •  长发绾君心
    2020-11-22 10:11

    Here's one I made on a 1 Million point set with 3 categories (colored Red, Green, and Blue). Here's a link to the repository if you'd like to try the function. Github Repo

    histplot(
        X,
        Y,
        labels,
        bins=2000,
        range=((-3,3),(-3,3)),
        normalize_each_label=True,
        colors = [
            [1,0,0],
            [0,1,0],
            [0,0,1]],
        gain=50)
    

提交回复
热议问题