Questions tagged [contourf]

Filled two-dimensional contour plot

Function Reference

A filled contour plot displays isolines calculated from matrix Z and fills the areas between the isolines using constant colors. The color of the filled areas depends on the current figure's colormap.

contourf(Z) draws a contour plot of matrix Z, where Z is interpreted as heights with respect to a plane. Z must be at least a 2-by-2 matrix. The number of contour lines and the values of the contour lines are chosen automatically.

contourf(Z,n) draws a contour plot of matrix Z with n contour levels.

contourf(Z,v) draws a contour plot of matrix Z with contour levels at the values specified in vector v.

contourf(X,Y,Z), contourf(X,Y,Z,n), and contourf(X,Y,Z,v) produce contour plots of Z using X and Y to determine the x- and y-axis limits. When X and Y are matrices, they must be the same size as Z, in which case they specify a surface as surf does.

[C,h,CF] = contourf(...) returns the contour matrix C as calculated by the function contourc and used by clabel, a vector of handles h to patch graphics objects, and a contour matrix CF for the filled areas.

Documentation: http://nf.nci.org.au/facilities/software/Matlab/techdoc/ref/contourf.html


Function Reference

matplotlib.pyplot.contourf

364 questions
0
votes
2 answers

How to fix contourf plot interpolating across NaN region?

I'm trying to create a countourf plot with the region in the bottom left hand corner whited out. Values for the contour are provided at the corner of each rectangle in the below image and all other points on the mesh have a value of NaN. I want to…
0
votes
2 answers

How to display all the colors in the color bar into the contourf plot?

I have this beautiful code which displays two contour plots. I was wondering if all the colors in the color bar can be displayed in a continuous manner instead of discrete manner? Here is the code below and thank you: [r,x] =…
0
votes
1 answer

Setting a color to a certain value in Matlab contourf

I want to plot the time evolution of a process using contourf in Matlab. The problem is at different time steps Matlab finds the maximum and minimum of my data and sets the colors accordingly, so p=1000 in the first plot could be blue and in the…
Eman
  • 165
  • 1
  • 1
  • 8
0
votes
1 answer

Is controlling the colors in contourf possible?

Good afternoon, I have this code in which I would like to specify three colored regions. One is when the final function C and C1 merged together as shown in the code is either less than 0 , between 0 and 1, and when greater than 1. In the code i…
0
votes
0 answers

Octave contourf() Not Coloring in the Line

I'm having trouble filling in my curves using contourf() on Octave. I'm running Octave 3.6.4 on Mac OS X 10.8.5. When I use contour(x,fp,data3) I get the following, which is correct: [Contour plot of data, not filled] However, when I want try…
cbw
  • 247
  • 3
  • 9
0
votes
1 answer

Contour plot showing no result

I was just wondering I have the following code: [r,R] = meshgrid(2:0.01:10,-4:0.01:4); Z=(((R).^2)-1 ); A=2+ (R.*(r+r^-1)); B=sqrt(Z).*(r-r^-1); C=((r+r^-1)./(sqrt(Z))).*acoth(A./B); figure contourf(r,R,C); h=colorbar; …
0
votes
1 answer

Python : How to export a contourf to a 2D array?

From a complex 3D shape, I have obtained by tricontourf the equivalent top view of my shape. I wish now to export this result on a 2D array. I have tried this : import numpy as np from shapely.geometry import Polygon import skimage.draw as…
Patrick
  • 45
  • 9
0
votes
2 answers

Matlab plotting data with specified condition with contourf

I have data in a matrix generated in a nested for loop. I want to only plot the data that meets a certain condition (e.g. it must be bigger than 0.6). Whether or not the data point meets that condition is stored as 1 or 0 in my mlist matrix. What is…
Medulla Oblongata
  • 3,771
  • 8
  • 36
  • 75
0
votes
0 answers

Contour plot fuzziness

I have produced a contour image in python using contourf, shown below. However, there is a problem with the quality of the image as can be seen by the white threading which covers almost all of it. Has anyone an idea as to why this occurs and how to…
inquiries
  • 385
  • 2
  • 7
  • 20
0
votes
1 answer

Removing a specific contour line in MATLAB

I'm using contourf to plot values from a 3D matrix, but I want a specific contour not displayed in my plots. Following is the code I use to plot said matrix. subplot(3,1,1) contourf(squeeze(u(ja,ia,1))) [Lu,mu] = contourf(squeeze(u(ja,ia,1))); ou…
0
votes
0 answers

Matlab unsorted data points contour plot

I want to make a contour plot of some data I get from a program. I get three matrices: X , Y and Z contourf(X,Y,Z) These matrices are of equal size. The matrices X and Y are not constructed using a meshgrid and are generally unsorted. My plot…
Rene
  • 41
  • 4
0
votes
1 answer

Contour plot size and action

I am having a bit of trouble with my output of my code to produce a 2d contour plot. I show the result below. As may be seen, the y axis is greatly distorted, and yet my code seems to have nothing within it which should cause this. My code is…
inquiries
  • 385
  • 2
  • 7
  • 20
0
votes
0 answers

How to plot global data from a .txt file using basemap and contourf

Been struggling with this a while and think I've reached as far as I can on my own! I'm trying to plot data from a .txt file onto basemap using contourf. I think I have reshaped the data correctly to fit, but it seems that the latitude values are…
0
votes
1 answer

How to display the true range of my parameters on a contour plot in MATLAB?

I want to display the values of a function Z = Z(x,y) in the range (x_min, x_max) and (y_min, y_max) using the contourf function in Matlab 2015a. Here is my code: N = 20; x_min = 20; x_max = 40; y_min = 40; y_max = 80; x = linspace(x_min, x_max,…
user2738748
  • 1,106
  • 2
  • 19
  • 36
0
votes
0 answers

Matlab, Contour(X,Y,Z), grid contour with regard to probability or distance costs

Can contour work to create grid contour? My data is like the first picture. I want to create graph like (1) x y are column 1 and column 2 as the grid coordinate (2) column 3 is the costs "Z". In applications, column 3 is the distance. I can do this…
Alex
  • 1
  • 2