matplotlib pcolormesh plot from x,y,z data

后端 未结 4 540
深忆病人
深忆病人 2021-01-06 03:03

I have data in a textfile in tableform with three columns. I use np.genfromtxt to read all the columns into matplotlib as x, y, z.

I want to create a color meshplot

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-06 04:03

    I had the same problem and agree with Gustav Larsson's suggestion to use

    scatter(x, y, c=z)
    

    In my particular case, I set the linewidths of the scatter points to zero:

    scatter(x, y, c=z, linewidths=0)
    

    of course, you can play around with other decorations, color schemes etc., the reference of matplotlib.pyplot.scatter will help you further.

提交回复
热议问题