contour

Python - Problems contour plotting offset grid of data

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 05:48:04
问题 My data is regularly spaced, but not quite a grid - each row of points is slightly offset from the one below. The data is in the form of 3 1D arrays, x, y, z, with each index corresponding to a point. It is smoothly varying data - approximately Gaussian. The point density is quite high. What is the best way to plot this data? I tried meshgrid, but it gives me some bad contours through regions that have no data points near the contour's value. I have tried rbf interpolation according to this

Create Contour or Heat Map with 3 Columns of Data

北慕城南 提交于 2019-12-12 05:48:02
问题 I have data with 3 columns separated by commas in a file 'data.txt' x,y,z 12,12,5.2 12,26,12.1 12,40,3.5 Where x and y are the (x,y) coordinates (range 12-2000) and z is the value/intensity at that point. What is the best way to graph this data? My initial thought was plotting as a 3-D contour plot and view it down the Z-axis, but even that is giving me some issues. I've made due plotting this as an array and plotting using imshow, but I know there's a better way. What advice do you have?

Contour lines with labels in heatmap with GNUplot

邮差的信 提交于 2019-12-12 04:32:34
问题 Following this question, I have now a heatmap with custom colorbar. Now I need to put contour lines with labels. I have created the contour lines, but I can't figure out how to put them. This is the plot I currently have: Code to generate the plot: reset #Function map values on desired ranges. The values set to 90,95,99 are for later labelling step(x) = (x < 20.0 ? 0 : (x < 50.0 ? 10 : (x < 75.0 ? 20 : (x < 90.0 ? 80 : (x < 95.0 ? 90 : (x < 97.5 ? 95 : (x < 99.0 ? 97 : (x < 99.5 ? 99 : (x <

How to make two small changes to a contourplot produced in lattice

落花浮王杯 提交于 2019-12-12 02:58:31
问题 I would like to make two cosmetic changes to a contourplot using the lattice function. These are to expand the size of the panel titles; add a title to the legend and key section, and shrink the colorkey object to fit this. A graphic showing what I mean is below, as on this occasion it will likely be more informative than the code. Solutions to either or both problems much appreciated. 来源: https://stackoverflow.com/questions/25400734/how-to-make-two-small-changes-to-a-contourplot-produced-in

Pcolor data plot in Python

两盒软妹~` 提交于 2019-12-12 02:15:02
问题 I'm trying to plot a matrix in python using pcolor. This is my code but it's not working. can you show me how to plot the matrix?! Matrix = np.zeros((NumX, NumY)) for i in range(NumX): for j in range(NumY): Matrix[i][j] = Data[i*NumY+j+1] # Set up a regular grid of interpolation points xi = np.arange(0, NumX*1.5, 1.5) yi = np.arange(0, NumY*1.5, 1.5) X, Y = np.meshgrid(xi, yi) intensity = np.array(Matrix) plt.pcolormesh(X, Y, Matrix) plt.colorbar() plt.show() this is the error : TypeError:

How to produce contour plot in R from matrix

ぐ巨炮叔叔 提交于 2019-12-11 16:15:03
问题 I have a file containing an nxn matrix of numeric values with a header row and column containing labels. I want to produce a contour plot of the values with R (2.14.x) so I am loading in the matrix like so: mat <- as.matrix(read.table("myfile", row.names=1, sep=",", header=TRUE)) and then attempting to produce a contour plot by: contour(rownames(mat), colnames(mat), mat) but I get the error: Error in r[i1] - r[-length(r):-(length(r) - lag + 1L)] : non-numeric argument to binary operator An

Find contour of multiple objects with their holes

≯℡__Kan透↙ 提交于 2019-12-11 14:16:32
问题 This is a follow up question from: How to obtain boundary coordinates of binary mask with holes? Given the same image: I want to get a separate list for each object of (x, y) -coordinates of the outer contour and its inner contour. Ideally, I want to use this list to plot the object (outer and inner contour) on a separate blank canvas. import matplotlib.pyplot as plt # For plotting import cv2 from skimage import io # Only needed for web grabbing images, use cv2.imread for local images # Read

Opencv - Active contours

烂漫一生 提交于 2019-12-11 12:44:39
问题 I am trying to use the active contour algorithm using OpenCV function. There is an implementation named cvSnakeImage . But I can't find an example in the OpenCV documentation. I found an example here. I added some lines and I expect that this code segments the image but the result is not expected. The points from snake method don't move. I edited a function from this code. And it is here : void AactiveSnake(IplImage* image) { points = (CvPoint*)cvAlloc(15*sizeof(CvPoint*)); int x,y; for(int i

Drawing contours retrieved from the binary image

最后都变了- 提交于 2019-12-11 11:39:39
问题 I want use findContours with the binary image, but the callback function causes an error: Invalid address specified to RtlFreeHeap when returning. When i want to use clear() to free the vector<vector<Point> > value, it causes the same exception and the code crashed in free.c at the line: if (retval == 0) errno = _get_errno_from_oserr(GetLastError()); For example: void onChangeContourMode(int, void *) { Mat m_frB = imread("3.jpg", 0); vector<vector<Point>> contours vector<Vec4i> hierarchy;

about plot contour figure by using r code

倾然丶 夕夏残阳落幕 提交于 2019-12-11 11:34:15
问题 I am a green-hand on R code. Now I meet some trouble in plotting contour figure by using R code. I have checked help(filled.contour) which tells that if you want to plot the contour, x,y should be both in ascending order. Actually, I receive the data randomly, like: latitude, longitude, value 37.651098 140.725082 9519 37.650765 140.725248 9519 37.692738 140.749118 23600 37.692737 140.749118 9911 37.692695 140.749107 16591 37.692462 140.74902 6350 37.692442 140.749052 5507 37.692413 140.749148