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

Using matlotlib: why do imshow and contourf not plot together? (contourf "overrides" imshow)

I am trying to plot some meteorological data onto a map and I would like to add an image of a plane using imshow. Plotting i) the trajectory, ii) some contour-data and iii) the image, works fine. But as soon as I add a contourf-plot (see below) the…
C Schwenk
  • 21
  • 3
0
votes
1 answer

How i can plot this contour?

I would like to get this result without the circles: This is my code: from matplotlib import pyplot as plt import numpy as np …
0
votes
1 answer

How to embed contourf into tkinter?

We have some discussions about embedding a matplotlib with slider in tkinter Python: Embed a matplotlib plot with slider in tkinter properly The key part is the following codes import matplotlib.pyplot as plt from matplotlib.widgets import…
Denny
  • 223
  • 2
  • 15
0
votes
1 answer

Customise polar contour plot axes style

I am using GridSpec to create a grid of polar contour plots in matplotlib. To aid with the visuals, I am trying the customise the appearance of the contour plots. See this single polar plot as an example (MWE below) I have two formatting questions…
Sid
  • 266
  • 5
  • 13
0
votes
1 answer

How to display multiple graphs with overlapping data in the same figure thank to matplotlib?

I'm searching to plot multiple graphs (here is 2) from colormap or contourf functions with different axis X, Y and data Z in the same figure. However I only want to display the maximum of each data with a single color bar for all of the graphs. In…
Tristan
  • 3
  • 2
0
votes
1 answer

Mapping certain value to a color using contourf in matplotlib

I've been trying to solve this problem for days, but none of the solutions I found online seem to work very well for me, despite how simple the problem seems. import numpy as np from matplotlib import pyplot as plt grid_x = np.linspace(-5, 5,…
punypaw
  • 133
  • 3
0
votes
1 answer

tricontourf breaking when contouring over 0 point in polar plot

I am trying to plot a tricontourf on a polar plot, however it seems that it glitches out when plotting over the 0 longitude point. It's clear when plotting as a scatter plot that the points are just fine. Furthermore, when plotting the tricontourf…
morhc
  • 194
  • 11
0
votes
1 answer

shadow an area on contour matlab

I'm tiring to plot contour map like picture is following below , i can plot the contour, but problem is with shadow area on contour . actually i have 4 vector data [x,y,z,k]. x,y area coordinates and z , k are levels . my…
amir1122
  • 57
  • 5
0
votes
0 answers

How do I plot filled contours with a masked numpy array?

I have a masked numpy array that contains temperature values. It was created by taking the mean temperature from a maximum and minimum temperature dataset. Those datasets also contained masked arrays. I then went ahead and calculated a subtraction…
0
votes
0 answers

Colorbar with closer spacing of colors near zero (almost like inverse logarithmic scaling)

sadly I could not find an answer to my question online. Essentially, I am trying to use a colorbar for a contourf plot that has closer spacing of the colors near zero (as I am interested in the small changes) and larger ranges for colors further…
random__human
  • 99
  • 2
  • 9
0
votes
0 answers

Extended colorbar with defined colors for contourf

I am plotting using contourf in which color schemes are user-defined and colorbar is extended at both ends. But same color is appearing for the last two-interval at both ends (as in the figure). I am expecting different colors as defined for each…
Aristocrat
  • 103
  • 1
  • 1
  • 5
0
votes
1 answer

Contour plots in python with time on X-Axis

I wish to do a contour plot in python with the sample data given below:- X-Axis(Time) Y-Axis(D) Z-Axis(C) 15:18:48 10 26 15:18:49 11 28 15:18:50 13 30 . . . . . …
0
votes
0 answers

Contour Plot in Python. X-Axis=time, y-Axis is Concerntration and Z-Axis consist merged columns consisting of diameter data

I want to create a contour plot as below, x_axis:Time, Y_axis:Nd, Z-axis:merged column data of D3-D8 column into 1 single variable named 'Matrix' For this data: My code: enter code here import numpy as np import matplotlib.pyplot as…
0
votes
0 answers

Python matplotlib.pyplot: contourf not filling contours

For some reason plt.contourf() doesn't fill all of the contours and I am not sure why. I am including an example image as well as the code that I used. The values in the array are clearly non-zero, based on the coloration of the different…
0
votes
1 answer

Python highlight user chosen area in contourf plot

What is the best solution for highlighting an area in a contourf plot? I want the background to be opacity of 0.5 and the user chosen area to be normal. How can I achieve this?
J CB
  • 25
  • 4