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

Background lines appear in foreground when save figure - contourf

I am new to Matlab and your help would be highly appreciated. My problem is simple. I plot some diagonal lines at first, and then I plot a data set via the "contourf" command on top of such lines. This data set matrix has some elements defined as…
AMaz
  • 181
  • 1
  • 2
  • 10
0
votes
1 answer

Plot filled contour at screen resolution

I am trying to plot a filled contour using matplotlib. I am using imshow to plot the contour. How can I plot the contour at the size of the screen resolution. For example, (x,y) are coordinates and z is corresponding value to the location: import…
Ram Krix
  • 1
  • 1
0
votes
1 answer

Matlab contourf plots interpolation

Hi If I have data like this e.g. x=[1:1:7]; y=[5:-1:1]'; z=[NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.955113030084974 0.948571658876062 0.942624899410361 NaN NaN NaN NaN 0.937493758208870 0.928392864395896 …
Ib_Ade
  • 1
  • 2
0
votes
1 answer

how to change the shape of a contour in matplotlib

I am using contour or contourf in matplotlib And the data is a 2D array with values in, like this: 1 2 3 3 3 2 3 3 4 1 2 3 4 5 6 ... The result I got is as below. It is like a square, while actually, the y extent is 600+ and x extent is only…
rankthefirst
  • 1,370
  • 2
  • 14
  • 26
0
votes
1 answer

Python basemap simple contours won't show up on map

I am trying to create filled contour lines on a basemap using contourf. This is the code I am using. No error occurs and it runs fine, and even the colorbar appears, but no contours are shown and the map background is only white. How do I make the…
0
votes
1 answer

contourf not working when setting xscale in logarithm

I am trying to plot with coutourf() but with xscale in logarithm : contourf(data); set(gca,'XScale','log'); But as I set the xscale I'm loosing the filling (became kind of a contour but without color). I try to use the GUI for plot and I have the…
Rafnuss
  • 119
  • 1
  • 14
0
votes
1 answer

putting together 2 contours in matlab.

I'm making my own Shakemap (so far, Shamemap) with Matlab. A Shakemap is a representation of the intensity of ground shaking in a map (google it up for more info). I want it to be similar to those from the USGS, in which they plot the intensity…
Ariaramnes
  • 943
  • 2
  • 10
  • 18
0
votes
1 answer

How do make contourf in matlab

I have data (31,3), column 1 is time (T), column 2 is altitude (H) and column 3 is parameter (P) I want to plot as contourf. How do I make contourf of P? as function of T and H. Thank you in advance. T is between 18 and 24, H is between 150 and 600.…
-1
votes
1 answer

Interpolating grid with NaN values for plotting with contour

I have a table I create from a larger dataset which gives me the y, x, and z values that I want to plot. I create a grid and then interpolate the values, but I don't think the function interpolation along the rows correctly since I can see data as…
-1
votes
2 answers

Show only desired label in contour plot in matplotlib

import matplotlib.pyplot as plt import numpy as np x = np.linspace(1,5,20) y = np.linspace(1,5,20) [X, Y] = np.meshgrid(x, y) Z = X**3+Y**3 ax = plt.axes() contours = plt.contour(X,Y,Z, 3, colors='black') plt.clabel(contours,fmt = '%2.2f',…
cb vaswar
  • 7
  • 2
-1
votes
1 answer

Contour plots of a function of several variables

I have a function of several variables H(x,y,z,w)=2xy+3zw-x^2+W^3. I need to draw the contour plot of the function H with respect to x and y when z=3 and w=5. Any help on drawing this contour plot using R would be greatly appreciated. Thank you!
Hew123
  • 63
  • 5
-1
votes
1 answer

Creating numpy array where values are within the range of two other arranges of the same size

I have created a map of a particular climate variable, which has been produced by extracting data from netCDF4 files and converting them into mask arrays. The data is the ensemble mean of 9 CMIP6 models. I would like to plot over the top of this…
-1
votes
1 answer

Getting memory error while using excel data

I am trying to do a contour plot using data from excel. But I am getting error as "MemoryError: Unable to allocate 55.6 GiB for an array with shape (86400, 86400) and data type float64". If anybody can help me by showing how to solve this and plot…
Debashis Paul
  • 67
  • 1
  • 10
-1
votes
1 answer

How can I convert 1-D plot to 2-D contourf plot?

If I generate a 1-D probability distribution and get a result like below: How can I convert this into a two-dimensional contourf plot, assuming the y-axis would be the same as the x-axis. Below, I created an image of what I would like the result to…
mj1496
  • 61
  • 1
  • 9
-1
votes
1 answer

How do I create a colormap from an existing data set in Matlab?

I currently have a 2-D contour plot in Matlab from an existing data set. I made an [x,y] mesh grid and used this mesh grid and z-data to produce a 2-d contour plot using contourf(x, y, z). My goal is to reproduce this same data as a colormap, with…
1 2 3
24
25