I have a 3 column irregular data in the format [X Y Z]. I am having difficulty in creating a contourf
plot for the same since it requires one to create a meshgrid and also that data be uniform among the grid.
I need some direction or hint to get started.
CodePudding user response:
I am providing two ways in which you can create a contour/density plot for the data which is in 3-column format and irregular, as you have mentioned.
You can use Mathematica: see the documentation of ListDensityPlot. You can directly provide the data as,
ListDensityPlot[{{x1,y1,f1},…,{xk,yk,fk}}]
, and this will plot the sought density plot.There is also a simple way to do this in python: You can see the documentation of tricontourf, a module of matplotlib. Its functionality is similar to that of
contourf
, except that you give 1D arrays rather than the data in mesh grid format.