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
1 answer

Two plots aren't exactly on-top of each other

I have a contourf plot and a matplotlib.collections.LineCollection as mc plot that I drew on top of each other on the same axis but they aren't exactly on top in the case where one is shifted to the left from the other what can I do to make them be…
Mahmoud Ayman
  • 197
  • 1
  • 13
0
votes
1 answer

How to plot contourf and my graph in the same figure

I have a figure showing the contourf plot and another showing a plot i've made earlier and I want to plot both on the same figure what should I do? Here is the code of my contourf plot: import pylab as pl from pylab import * import xlrd import…
Mahmoud Ayman
  • 197
  • 1
  • 13
0
votes
1 answer

Modifying meshgrid function

I have this piece of code regarding the meshgrid function that I want to modify it's output: x_list = list(range(5)) y_list = list(range(2)) X, Y = meshgrid(x_list, y_list) which prints out: X array([[0, 1, 2, 3, 4], [0, 1, 2, 3, 4]]) and …
Mahmoud Ayman
  • 197
  • 1
  • 13
0
votes
1 answer

Value error in drawing the contourf plot

I want to draw the contourf of a certain function and my code was as follows: xlist = linspace(0, 100, 100) ylist = linspace(0, 100, 200) X, Y = meshgrid(xlist, ylist) #print "X = " + str(X) #print "Y = " + str(Y) Z = power_at_each_point(X,…
Mahmoud Ayman
  • 197
  • 1
  • 13
0
votes
0 answers

Use regionprops to get table with label and area

So i have this plicture that i made from a microscopic image of a composite sample. Basically what I did is that i have an array A that contains the value of an angle Phi from -90 to +90 degrees. and then I used contourf to get this plot: Now I…
0
votes
1 answer

Calculating area with regionprops matlab

I have this plot that I made using contourf This is a microscopic picture where I am trying to get the orientation of each ply. I have made a colormap where i have a constant color for each 10 degree. So basically i am kind of assuming a constant…
0
votes
1 answer

Create a colormap in matlab

I have a contour plot with data that goes from -90 to 90 degrees. for now i am using jet so I have a map that looks like this I have been asked to change the colormap so that instead of having a gradient, I have a fixed color for each 5 degress (so…
0
votes
0 answers

Preparing data for contour plot

I'm analyzing the maximum load for a mechanism in 2D-space and want to plot the load capacity for a certain point at different positions inside the working area and figured a contour plot with the position in x and y and the load as the color range…
JaS
  • 1
  • 2
0
votes
1 answer

Matlab: contourf or colormap to plot filled ellipses according to radius

I am trying to use either the contourf or colormap functions to plot filled ellipses with colors according to their arcsin(b/a) value (a=major axis, b=minor axis). clearvars -except data colheaders close all clc data(:,9)=data(:,9)*pi/180; %…
0
votes
2 answers

Wrong Aspect Ratio for Contour Plot with Python (Matplotlib)

I import a fits file and basically want to plot it as a contourplot. The problem arises with the aspect ratio. The image has 320x240 dimensions and since I don't want the picture to be stretched, I want the ratio of the image to be 320/240 also.…
KidA
  • 1
  • 1
  • 3
0
votes
1 answer

Need the following curve to be one color? (MATLAB)

I am new here and have small experience with matlab. Here I have a contour plot, with each area between the contours depicted with different colors across a colorbar. I would like to know how to prevent this coloring, and instead just have it a…
0
votes
2 answers

Matlab filled contour colors not updating

I am trying to adjust the color limits of a contour using contourf and caxis, but the number of colors in the contour does not update. Please see the example below. Z is an array of values ranging from -170 to 80. I want to plot 20 contours of the…
Iodestar
  • 198
  • 2
  • 13
0
votes
2 answers

Why doesn't the contourf function in Matlab use the highest value of the plotted data?

does anybody know why the function countourf doesn't use the color corresponding to the maximum value anywhere in the plot area? if you try the code below, and then the command get(h_colorbar,'YLim') Matlab returns an upper limit which is not the…
ER-
  • 3
  • 1
0
votes
1 answer

error in loading contourf

I recently encountered this error when updating to ubuntu 14.04 64bit. I cannot understand what is going on. Suspecting a PATH/LIBRARY etc. error. Similar happens when trying to load programs that I used with MCR. What could be the problem? These…
Caglar
  • 1
  • 1
0
votes
3 answers

Matlab and XTickLabel

I've been trying to get Matlab to change the labelling on my contourf plots for about an hour now. When I go to change XTickLabel or XTick, it simply removes my x-axis altogether! The frustrating and infuriating thing is that I'm doing exactly what…
Yoshi
  • 671
  • 8
  • 20