pcolor

pcolor(X, Y, C::Matrix{<:Real}; kwargs...)

Creates a colored cells plot using the values in matrix C. The color of each cell depends on the value of each value of C after consulting a color table (cpt). If a color table is not provided via option cmap=xxx we compute a default one.

D = pcolor(X, Y; kwargs...)

This form, that is without a color matrix, accepts X and Y as before but returns the tiles in a vector of GMTdatasets. Use the kwargs option to pass for example a projection setting (as for example proj=:geo).

pcolor(G::GMTgrid; kwargs...)

This form takes a grid (or the file name of one) as input an paints it’s cell with a constant color.

Examples

using GMT

G = GMT.peaks(N=21);  # Create an example grid
pcolor(G, outline=(0.5,:dot), show=true)

Now use the G x,y coordinates in the non-regular form

using GMT

pcolor(G.x, G.y, G.z, show=true)

Add labels to cells using default settings (font size = 6p)

using GMT

pcolor(G.x, G.y, G.z, labels=:y, show=true)

Similar to above but now set the number of decimlas in labels as well as it font settings

using GMT

pcolor(G.x, G.y, G.z, labels=2, font=(angle=45, font=(5,:red)), show=1)

Display a Pearson’s correlation matrix

using GMT

pcolor(GMT.cor(rand(4,4)), labels=:y, colorbar=1, show=true)

An irregular grid

using GMT

X,Y = GMT.meshgrid(-3:6/17:3);
XX = 2*X .* Y;  YY = X.^2 .- Y.^2;
pcolor(XX,YY, reshape(repeat([1:18; 18:-1:1], 9,1), size(XX)), lc=:black, show=true)

See Also

grdview, plot