How to create a contour graph?

How to create a contour graph as follows: contour http://www.fz-juelich.de/vislab/software/gsharp/Gsharp/userguide/interpolate/ex6.gif

It's easy enough if the points are on a regular grid, but what if they are not the same as in my example? Is there a simple algorithm for determining the color for each pixel?

+3
source share
5 answers

Maybe a little late

however, in newer versions of matplotlib you can get grid data:

http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data

maybe it helps

+3
source

, . , , - , , . ( , " " , , , )

.

.

Gnuplot

, .

, , .

:

Example GnuPlot contour image
(: lanl.gov)

+2

XYZ XYZ . , .

- , , , . , , .

, .

+1

. , , Matlab pcolor, . , pcolor - , (0,90).

, - tricontour, . , .

pcolor- , delaunay , trisurf. ...

tri = delaunay(x,y);
trisurf(tri,x,y,z)
view(0,90)

Admittedly, this solution will not give you a beautifully circular color domain in the original image. This will require other, more complex solutions. But since I'm not sure whether the solution I put above will be acceptable, I will stop here for now.

+1
source

See 2D interpolation. There are some simple algorithms, but they may not work as well (or spend a lot of time computing).

0
source

Source: https://habr.com/ru/post/1723267/


All Articles