'pcolor' equavalent plotting method

Hi,

I am wondering if there could be a more convenient way to make a plot like 'pcolor' (flat shading) function in MATLAB/matplotlib, which makes a color plot for a non-gridded XYZ data without interpolating.

This type of plot is used a lot in our data analysis that the parameters (such as temperature, magnetic field) cannot be perfectly controlled with ideally same intervals. Given a case that a resistance is measured by varying temperature and magnetic field, although the 'set' parameter points are ideally gridded, while due to fluctuation and PID controls, the 'real measured'  parameter points are not gridded. In these measurements, the final results will be returned as three 2-D waves X(u,v), Y(u,v), Z(u,v), where u,v are the 'set point' of parameters, X, Y are the 'measured' values of parameters, and Z is the quantity of interest, and the goal is to visualize the Z(X, Y). 

I found two viable approach in current version of Igor pro, but both of them cannot provide a figure with satisfying quality as MATLAB or matplotlib provides.

1) 'Plotting 1D X, Y and Z Waves With Non-Gridded XY Data' - The interpolation is not preferred, with dense parameter points, 'flat shading' option in MATLAB can visualize data in a smooth and accurate representation. In addition, the data has to convert into 1D wave first, during which it lost the information of the 'mesh unit' and make the operating time longer. 

2) 'Parametric Surface Data Formats' for Gizmo figure - It provides a figure that is exactly same mechanism as 'pcolor' function do, however, the detailed modification is difficult in Gizmo panel. Especially the axis properties cannot be easily changed for X, Y axis, and it frequently outputs the axis with unclear fonts or labels.

In all, I believe it will be greatly helpful with a separate function that visualize Gizmo figure with 'Parametric Surface Data Formats' input and fixed top view direction, but with more handy axis help as in image plot panels. 

I don't know about others, but I have no idea what a "pcolor" plot is. Could you post a picture of what you are aiming for?

It would greatly help if you could post a minimal experiment file containing your data and a plot example in Matlab using the same data. Then we could work on how to achieve the same in Igor most effectively.

Hi, 

The source files and the desired plots made by python matplotlib is showed in png files. Figure 1 shows the plot for Z(X,Y), where X and Y are in gridded topology but not exactly spaced.

Figure 2 shows a coordinate transformation from (X,Y) -> (x1,y1), and then Z(x1,y1) was plotted. In matplotlib, this plot can be generated by the same method with figure 1 by a simple command 'pcolor(x1,y1,Z)'. While in igor pro, it can only be visualized in gizmo surface plot with parametric data input. 

matplotlibpcolor_1.png (275.25 KB) matplotlibpcolor_2.png (550.79 KB) All source files (5.52 MB)

According to my research, pcolor in MatLab uses bilinear interpolation by default. This interpolation method and others are available in the ImageInterpolate operation. Are you confident enough from this information to appreciate how to translate the default MatLab pcolor command to an equivalent ImageInterpolate operation in Igor Pro?

There are many options for handling this in Igor.  For example, you can use ImageInterpolate with the keyword voronoi to create a matrix of value from the scatter data.  You can also use ImageTransform with the voronoi keyword (see the Voronoi Tesselation example).  You may also want to look at AppendXYZContour and ImageFromXYZ.

The OP said "without interpolating" so if you just obtain the triangulation you can plot the surface without interpolation.  I do however encourage you to look at the concept of Voronoi interpolation that produces results that do not suffer from typical interpolation problems.

AG