contour

How can I draw inline line labels in matplotlib?

廉价感情. 提交于 2019-12-03 16:41:06
问题 I have the following graph, consisting of several lines: Now, I would like to label all the lines in the plot. However, using legend() crams all the labels together in a box, which makes the plot somewhat difficult to interpret. What I'd like to to instead is to use inline labels. My ideal output would use labels like the following matplotlib contour plot, but with text labels for lines instead of numbers: I haven't been able to find out how to do this in the matplotlib documentation. Is

Creating a filled contour plot using data in lists

若如初见. 提交于 2019-12-03 16:03:48
I have a data set that consists of 3 columns in a .csv file. The first 2 columns are map co-ordinates and the third is the percentage of zinc found in a borehole at the corresponding map co-ordinates. I would like to create a contour map to show the Zn concentration changes with distance. All of the examples of code I have been able to find use data in the form of a matrix, whereas mine are in lists. I have tried several different ways of plotting this which I have shown underneath, the majority of methods give me error messages along the lines of "object x not found" which I think is to do

.NET Open Source Contour Plotting

梦想的初衷 提交于 2019-12-03 15:14:30
问题 I am looking for an Open Source .NET Library (or wrapper to a library) that will create contour plots from a set of values along a grid/mesh. ZedGraph is the closest thing I could find (http://zedgraph.org/). It would also be great if it could export to EPS. 回答1: With D3 you can plot contour lines (isolines) for WPF. I am not sure about contour surfaces. WPF has great printing capabilities so I think that printing to EPS would not be a problem. Edit: recently found this one WinForms example

Sorting contours left to right in Python (OpenCV)

吃可爱长大的小学妹 提交于 2019-12-03 15:14:24
问题 I'm using Python and OpenCV to detect contours in my image. But when I run the following code to draw only a specific contour using the contour index, since the indices allocated are random, I get the wrong output. So I found out the Centroids (in my case all the centroids lie in the same horizontal line). Is there any way I can sort the contour indices from left to right (starting from 0 to n) based on the x value of the centroid? Could you please show the code for the same? Any help would

Turn hist2d output into contours in matplotlib

一曲冷凌霜 提交于 2019-12-03 14:22:54
I have generated some data in Python using matplotlib.hist2d. An example of the data is seen below. As you can see this data has some contours in it found by tracing the same color throughout the plot. I see a gamma distribution centered around 0.015. I would like to take this data and gather these contours so I can see a line trace through each color level. I tried playing around with the contour function as here counts, xedges, yedges, Image = hist2d(x, y, bins=bins, norm=LogNorm(), range=[[0, 1], [0, 400]]) contour(counts) but that didn't seem to produce anything. Does anyone know the best

OpenCV || contour similarity

杀马特。学长 韩版系。学妹 提交于 2019-12-03 14:11:18
As you can see in the image, I would like to compare these contours. I need my OpenCV program to return TRUE when of these contours are compared to each other. They all kind off look the same but as you can see they are not exactly the same. The result you see here is what I have returned from the function findContours. So I am looking for the right approach for similarity for these contours. Any help would be amazing. Thank you very much in advance. Take a look at cvMatchShapes() (which used to be call cvMatchContours() ). krzych To use the matchShapes() function you should pass vector<Point>

Is it possible to create a 3d contour plot without continuous data in R?

左心房为你撑大大i 提交于 2019-12-03 14:10:44
I want to create a contour of variable z with the x,y,z data. However, it seems like we need to provide the data in increasing order. I tried to use some code but it gave me the error. I tried the following code: Trial 1: age2100 <- read.table("temp.csv",header=TRUE,sep=",") x <- age2100$x y <- age2100$y z <- age2100$z contour(x,y,z,add=TRUE,col="black") I got the following error Error in contour.default(x, y, z, add = TRUE, col = "black") : increasing 'x' and 'y' values expected I then tried to use ggplot2 to create the contour. I used the following code: library("ggplot2") library("MASS")

Hu moments comparison

老子叫甜甜 提交于 2019-12-03 13:51:09
i tried to compare two images and use Hu moment to compare contour extracted from these images: https://docs.google.com/file/d/0ByS6Z5WRz-h2WHEzNnJucDlRR2s/edit and https://docs.google.com/file/d/0ByS6Z5WRz-h2VnZyVWRRWEFva0k/edit The second image is equal to the first only it's rotated and i expected as result same Humoments. They are a little bit different. Humoments sign on the right (first image): [[ 6.82589151e-01] [ 2.06816713e-01] [ 1.09088295e-01] [ 5.30020870e-03] [ -5.85888607e-05] [ -6.85171823e-04] [ -1.13181280e-04]] Humoments sign on the right (second image): [[ 6.71793060e-01] [

Matplotlib streamplot arrows pointing the wrong way

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 13:48:41
问题 I am generating a groundwater elevation contour and a streamplot in matplotlib The contour indicates that the elevation is decreasing in many areas but the groundwater flow (streamplot) is pointed uphill. I have circled the arrows that seem to be pointed the wrong direction. The arrows toward the bottom of the map appear to be pointed the correct direction. Does anyone know why this might be? And here is most of the code which generates this plot: #create empty arrays to fill up! x_values = [

Drawing labels on flat section of contour lines in ggplot2

孤者浪人 提交于 2019-12-03 12:50:58
问题 In a previous question, I reproduced a contour plot generated with the fields package, in ggplot2 instead (full example below). The only trouble is, I would like to replicate the placement of the contour labels in contour() , which by default are at the "flattest" part of the line - the second picture might show why. I'm stumped by how to set up that calculation. I see here that it's possible to grab the data used to generate the contour lines, and then geom_text() could be used to plot the