0

I have a dataset made of three columns x,y and z showing weight of each (x,y). all three are 1D array. x and y are float numbers not simple index.

plt.scatter(x,y,c =z, cmap='YlGnBu')

scatter plot

which is cool but I actually want to plot it with 'heatmap' or 'counterf' to look better. something like: heatmap plot

I have read about similar questions on stackoverflow and matplotlib documentation but still didn't figure out how to do that. for counterf I can meshgrid x,y but I have no idea about what to do about z; beacuse there is no z for every possible combination of (x,y) which have to be calculated with some kind of preprocessing.

any idea how to do that?

  • Tnx Jody, just using `tricontourf` solved my problem! @JodyKlymak – mohammad farhady Jan 04 '22 at 10:37
  • @JodyKlymak actually I was struggling to figure out how this `tricontourf` works just now, read about triangulation but still did not found a straight forward explanation. this `tripcolor` I think can explain a lot. but still I'm not completely understood how `triconturf` works... – mohammad farhady Jan 04 '22 at 18:38

0 Answers0