Displaying 17 results from an estimated 17 matches for "geom_contour".
2017 Oct 09
0
example of geom_contour() with function argument
Hi BFD,
?geom_contour() *does* have helpful examples. Your Google-foo is weak:
Searching for geom_contour brought me:
http://ggplot2.tidyverse.org/reference/geom_contour.html as the first
result.
HTH
Ulrik
On Mon, 9 Oct 2017 at 08:04 Big Floppy Dog <bigfloppydog at gmail.com> wrote:
> Can someone please poin...
2017 Oct 09
2
example of geom_contour() with function argument
...ng from the dataset in the
example). Can you please point to the specific example that might help?
Here is what I get:
require(mvtnorm)
require(ggplot2)
set.seed(1234)
xx <- data.frame(rmvt(100, df = c(13, 13)))
v <- ggplot(faithfuld, aes(waiting, eruptions, z = drmvt, df = c(13,13)))
v + geom_contour()
Don't know how to automatically pick scale for object of type function.
Defaulting to continuous.
Error: Aesthetics must be either length 1 or the same as the data (5625):
x, y, z, df
Can you please tell me how to use this here? Or is some other example more
appropriate?
TIA,
BFD
On Mo...
2017 Oct 09
3
example of geom_contour() with function argument
...d paste the wrong snippet earlier and made a typo
in doing so, but the result is the same with the more appropriate snippet.
require(mvtnorm)
require(ggplot2)
set.seed(1234)
xx <- data.frame(rmvt(100, df = c(13, 13)))
v <- ggplot(data = xx, aes(x = X1, y = X2, z = dmvt, df = c(13,13)))
v + geom_contour()
Don't know how to automatically pick scale for object of type function.
Defaulting to continuous.
Error: Aesthetics must be either length 1 or the same as the data (100): x,
y, z, df
I do not understand how to put in a function as an argument to
geom_contour() and the examples in the help f...
2017 Oct 09
2
example of geom_contour() with function argument
Can someone please point me to an example with geom_contour() that uses a
function? The help does not have an example of a function, and also I did
not find anything from online searches.
TIA,
BFD
-----------------------------------------------------------------------------------------------
How about geom_contour()?
Am So., 8. Okt. 2017, 20:52 schrie...
2017 Oct 09
0
example of geom_contour() with function argument
...nt to the specific example that might help?
>
> Here is what I get:
>
> require(mvtnorm)
> require(ggplot2)
> set.seed(1234)
> xx <- data.frame(rmvt(100, df = c(13, 13)))
>
>
> v <- ggplot(faithfuld, aes(waiting, eruptions, z = drmvt, df = c(13,13)))
> v + geom_contour()
>
> Don't know how to automatically pick scale for object of type function.
> Defaulting to continuous.
> Error: Aesthetics must be either length 1 or the same as the data (5625):
> x, y, z, df
>
That's not what I get:
> v <- ggplot(faithfuld, aes(waiting, erup...
2017 Oct 09
0
example of geom_contour() with function argument
...compute density as a function of the grid of points
xx2$d <- dmvt( as.matrix( xx2[,1:2] ) ) # feels weird not specifying
measures of centrality or spread
ggplot( data = xx
, aes( x = X1
, y = X2
)
) +
geom_point() + # might want this line after the geom_contour
geom_contour( data = xx2 # may want to consider geom_tile as well
, mapping = aes( x = X1
, y = X2
, z = d
)
)
#' ![](https://i.imgur.com/8ExFYtI.png)
## genera...
2017 Jun 18
3
R_using non linear regression with constraints
..., lower = c( 1000, 0 )
, upper = c( 3000, 1 )
)
a <- as.vector( coef( myfit )[ "a" ] )
b <- as.vector( coef( myfit )[ "b" ] )
brks <- c( 500, 1e7, 2e7, 3e7, 4e7 )
ggplot( objdtass, aes( x=a, y=b, z = x, fill=x ) ) +
geom_tile() +
geom_contour( breaks= brks ) +
geom_point( x=a, y=b, colour="red" ) +
geom_point( x=objdtassmin$a
, y=objdtassmin$b
, colour="green" ) +
scale_fill_continuous( name="SumSq", breaks = brks )
# Green point is brute-force solution
# Red poi...
2017 Jun 18
0
R_using non linear regression with constraints
...upper = c( 3000, 1 )
> )
> a <- as.vector( coef( myfit )[ "a" ] )
> b <- as.vector( coef( myfit )[ "b" ] )
>
> brks <- c( 500, 1e7, 2e7, 3e7, 4e7 )
> ggplot( objdtass, aes( x=a, y=b, z = x, fill=x ) ) +
> geom_tile() +
> geom_contour( breaks= brks ) +
> geom_point( x=a, y=b, colour="red" ) +
> geom_point( x=objdtassmin$a
> , y=objdtassmin$b
> , colour="green" ) +
> scale_fill_continuous( name="SumSq", breaks = brks )
> # Green point is...
2008 Oct 05
0
ggplot2 - version 0.7
...les
* stat_density2d, geom_density2d: density2d used consistently (instead
of density_2d in some places)
Improved aesthetics
* coord_polar: more tweaks to grid lines to enhance appearance
* coord_polar: new expand argument to control whether axes should be
expanded outside the range of the data
* geom_contour, geom_smooth, geom_quantile: now use blue lines
* position_stack, position_dodge: should be more informative if
conditions for stacking/dodging not met
* position_jitter: default amount of jittering tweaked to align with
boxplots etc.
* scales: background colour of legends key matches plot
* themes...
2008 Oct 05
0
ggplot2 - version 0.7
...les
* stat_density2d, geom_density2d: density2d used consistently (instead
of density_2d in some places)
Improved aesthetics
* coord_polar: more tweaks to grid lines to enhance appearance
* coord_polar: new expand argument to control whether axes should be
expanded outside the range of the data
* geom_contour, geom_smooth, geom_quantile: now use blue lines
* position_stack, position_dodge: should be more informative if
conditions for stacking/dodging not met
* position_jitter: default amount of jittering tweaked to align with
boxplots etc.
* scales: background colour of legends key matches plot
* themes...
2017 Oct 08
0
how to overlay 2d pdf atop scatter plot using ggplot2
Hi,
I am no expert on ggplot2 and I do not know the answer to your question. I looked around a bit but could not find an answer right away. But one possibility could be, if a direct approach is not possible, to draw ellipses corresponding to the confidence regions of the multivariate t density and use geom_polygon to draw this successively?
I will wait for a couple of days to see if there is a
2007 Dec 13
2
Overlaying trellis xyplot on contourplot
Friends: I wish to overlay data points on a contour graph. The following
example produces a nice contour plot, but I have not mastered the concept
of using panel functions to modify plots. Can someone show me how to
overlay the data points (given after contour plot statement) on the
contourplot?
--Seth
model <- function(a,b,c,X1,X2) # provide model
function for contour
2017 Oct 08
2
how to overlay 2d pdf atop scatter plot using ggplot2
Note: I have posted this on SO also but while the question has been
upvoted, there has been no answer yet.
https://stackoverflow.com/questions/46622243/ggplot-plot-2d-probability-density-function-on-top-of-points-on-ggplot
Apologies for those who have seen it there also but I thought that this
list of experts may have someone who knows the answer.
I have the following example code:
2008 Nov 21
0
ggplot2 - version 0.8
...ch the defaults in other geoms (point,
line, etc)
* geom_line, geom_path, geom_segment: lines have squared ends
* geom_point, geom_pointrange and geom_boxplot: now use shape = 16
instead of 19. This shape does not have a border from R 2.8 on, and
so will look better when displayed transparently.
* geom_contour, geom_density2d, geom_quantile and geom_smooth use a
bright blue colour for lines, to make them stand out when used with
black points
* scale_gradient: tweaked default colours to make more aesthetically pleasing
* theme: new theme setting panel.margin (a unit) controls gap between
panels in facette...
2008 Nov 21
0
ggplot2 - version 0.8
...ch the defaults in other geoms (point,
line, etc)
* geom_line, geom_path, geom_segment: lines have squared ends
* geom_point, geom_pointrange and geom_boxplot: now use shape = 16
instead of 19. This shape does not have a border from R 2.8 on, and
so will look better when displayed transparently.
* geom_contour, geom_density2d, geom_quantile and geom_smooth use a
bright blue colour for lines, to make them stand out when used with
black points
* scale_gradient: tweaked default colours to make more aesthetically pleasing
* theme: new theme setting panel.margin (a unit) controls gap between
panels in facette...
2017 Jun 18
0
R_using non linear regression with constraints
I ran the following script. I satisfied the constraint by
making a*b a single parameter, which isn't always possible.
I also ran nlxb() from nlsr package, and this gives singular
values of the Jacobian. In the unconstrained case, the svs are
pretty awful, and I wouldn't trust the results as a model, though
the minimum is probably OK. The constrained result has a much
larger sum of squares.
2017 Jun 18
3
R_using non linear regression with constraints
https://cran.r-project.org/web/views/Optimization.html
(Cran's optimization task view -- as always, you should search before posting)
In general, nonlinear optimization with nonlinear constraints is hard,
and the strategy used here (multiplying by a*b < 1000) may not work --
it introduces a discontinuity into the objective function, so
gradient based methods may in particular be