contour

filled.contour in R 3.0.x throws error

风格不统一 提交于 2019-11-28 11:26:56
I have a customized function for plotting filled contours which is heavily based on Carey McGilliard and Bridget Ferris work ( http://wiki.cbr.washington.edu/qerm/sites/qerm/images/1/16/Filled.contour3.R ) and http://wiki.cbr.washington.edu/qerm/index.php/R/Contour_Plots . the filled.contour3 function runs perfectly in R 2.15.3 but throws an error in R 3.0.x Error in .Internal(filledcontour(as.double(x), as.double(y), z, as.double(levels), : there is no .Internal function 'filledcontour' Could you please help me with a solution or a workarround so that I can use the filled.contour3() function

OpenCV closing a shape and filling it

女生的网名这么多〃 提交于 2019-11-28 09:13:48
I want to output a blue-filled hand but get the incorrect output. I've included the input picture, incorrect output picture and code below. i think the code below does not fill the whole image because the image isn't closed yet at the right boundary. how do i close the shape and fill it with blue properly? #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <iostream> #include <stdio.h> #include <stdlib.h> using namespace cv; using namespace std; void drawStuff(); void showInputWindow(); void showCannyWindow(); void

Python matplotlib change default color for values exceeding colorbar range

∥☆過路亽.° 提交于 2019-11-28 08:10:30
When filling a grid with color such as when using contourf in pyplot, I need to find a way to change the color that pyplot uses to fill data that exceed the specified range of the colorbar. I wish to have a static colorbar that does not automatically change its range to fit the max/min of the data, so having occasional extreme values that exceed its bounds is inevitable, and colors need to be specified for such values. The default color for values exceeding the bounds of the colorbar is white, which can glaringly clash with the surrounding data if the colormap does not have white as its end

gnuplot contour line color: set style line and set linetype not working

不想你离开。 提交于 2019-11-28 07:49:13
I am plotting data as described in a previous Stackoverflow question: gnuplot 2D polar plot with heatmap from 3D dataset - possible? Mostly it is working well for me, and I am down to some small details. One of these is how to exert control over the contour line colors and linewidths. There are lots of posts on the web regarding using set style increment user followed by definition of user style via set style line 1 lc rgb "blue" lw 2 etc. In theory this was supposed to force splot to plot lines using the newly defined styles. I tried it and it did not work. In addition, when I went to the

What is the algorithm that opencv uses for finding contours?

旧时模样 提交于 2019-11-28 06:24:43
I need to use cv::FindContours() in a program and I have to know the algorithm behind that. What algorithm does openCV use to find contours? How does it work? fireant If you read the documentation it is mentioned this function implements the algorithm of: Suzuki, S. and Abe, K., Topological Structural Analysis of Digitized Binary Images by Border Following. CVGIP 30 1, pp 32-46 (1985) OpenCV is open source if you want to see how this is implemented just need to read the code: https://github.com/opencv/opencv/blob/master/modules/imgproc/src/contours.cpp#L1655 One of the answers to this question

How to plot contours on a map with ggplot2 when data is on an irregular grid?

妖精的绣舞 提交于 2019-11-28 03:45:58
问题 Sorry for the wall of text, but I explain the question, include the data, and provide some code :) QUESTION: I have some climate data that I want to plot using R. I am working with data that is on an irregular, 277x349 grid, where (x=longitude, y=latitude, z=observation). Say z is a measure of pressure (500 hPa height (m)). I tried to plot contours (or isobars) on top of a map using the package ggplot2, but I am having some trouble due to the structure of the data. The data comes from a

An Error in R: When I try to apply outer function:

本小妞迷上赌 提交于 2019-11-28 02:23:16
问题 Here is my code: Step1: Define a inverse function which I will use later inverse = function (f, lower = -100, upper = 100) { function (y) uniroot((function (x) f(x) - y), lower = lower, upper = upper)[1] } Step2: Here is my functions and their inverse: F1<-function(x,m1,l,s1,s2){l*pnorm((x-m1)/s1)+(1-l)*pnorm((x+m1)/s2)} F1_inverse = inverse(function(x) F1(x,1,0.1,2,1) , -100, 100) F2<-function(x,m2,l,s1,s2){l*pnorm((x-m2)/s1)+(1-l)*pnorm((x+m2)/s2)} F2_inverse = inverse(function(x) F1(x,1,0

How to draw a contour plot when data are not on a regular grid?

百般思念 提交于 2019-11-27 22:43:55
问题 Say I have 3 variables such that x=1:9 y=c(1,1,1,2,2,2,3,3,3) z=6:14 How can I rearrange the data so that I can make a contour plot of the data with r? I am getting the message Error in contour.default(x, y, z) : increasing 'x' and 'y' values expected Thank you. 回答1: z is a matrix of values where contour lines are to be drawn. x and y are their respective location. "Tyler" at r-help mailing list explains this and gives an example of how to transform your data to make things work. See also

Reverse and change limit of axis

China☆狼群 提交于 2019-11-27 22:42:25
I am trying to create a contour plot. I would like to have depth on the Y-axis and time on the X-axis. Right now this is the code that I am using: par <- ggplot(up_PAR, aes(Time.hour.of.the.day., Depth, z = PAR)) parplot <- par + stat_contour(bins=20, aes(colour=..level..))+ scale_colour_gradient(limits=c(0.000842, 0.00000000195),low="black", high="black") + scale_y_reverse()+ theme_bw()+ theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())+ xlab("Hour of the Day")+ ylab("Depth(m)")+ ggtitle("Downwelling PAR (photons/m2/s), January 22nd") direct.label(parplot) However,

How to crop the internal area of a contour?

試著忘記壹切 提交于 2019-11-27 19:51:43
I am working on Retinal fundus images.The image consists of a circular retina on a black background. With OpenCV, I have managed to get a contour which surrounds the whole circular Retina. What I need is to crop out the circular retina from the black background. It is unclear in your question whether you want to actually crop out the information that is defined within the contour or mask out the information that isn't relevant to the contour chosen. I'll explore what to do in both situations. Masking out the information Assuming you ran cv2.findContours on your image, you will have received a