R, how can I plot two functions in one 3d plot? (I show an example) - r

Do someone know how to plot two functions in one 3d plot using R as in the left-figure or right-figure shown below? (article reference at the end).
3d plot
For example, in 2d plot you have the argument "add" for the function curve(...)
For what I have searched, the functions I have found (like persp(...)) doesn't have an "add" option.
Thanks!
Reference:
Juan M. Astorga, Yuri A. Iriarte, Héctor W. Gómez & Heleno Bolfarine (2019):
Modified slashed generalized exponential distribution, Communications in Statistics - Theory and
Methods, DOI: 10.1080/03610926.2019.1604959

I already found a function which works perfect for what I need. If anyone are
interested, persp3D(...)
https://www.rdocumentation.org/packages/plot3D/versions/1.3/topics/3-D%20perspectives

Related

Plot 3D graphs in R-studio

Sorry for the question, but I have a variable that I would like to plot like this:
I am a newby on R, so I am having some difficulties. I appreciate any kind of help.
Thanks!
Since you're looking to plot what appears to be a 3d surface, I'd suggest starting with the persp function, from the graphics package. This blog post (http://www.r-bloggers.com/3d-plots-in-r/) gives a good treatment of several options for 3D plotting:
the generic function persp() in the base graphics package draws perspective plots of a surface over the x–y plane. Typing demo(persp) at the console will give you an idea of what this function can do.
And running demo(persp) gives you a number of examples, including this one:
There are also some more suggestions for going further:
The plot3D package from Karline Soetaert builds on on persp()to provide functions for both 2D and 3D plotting. [...] Load the package and type the following commands at the console: example(persp3D), example(surf3D) and example(scatter3D) to see examples of 3D surface and scatter plots.
As a side note, #rawr's comment is spot on - I found all this in less than a minute, using two google searches - one of which was the title of your post. I'm putting this answer up anyway, since StackOverflow posts frequently become the top google result for many topics. But the best advice I can give you going forward is that R is one of the most aggressively well-documented languages out there, both in terms of formal and informal documentation, and you can find a lot just by googling what you want to do.

How to reproduce this graphical explanation (a scatter plot) of how covariance works?

I found this graphical intuitive explanation of covariance:
32 binormal points drawn from distributions with the given covariances, ordered from most negative (bluest) to most positive (reddest)
The whole material can be found at:
https://stats.stackexchange.com/questions/18058/how-would-you-explain-covariance-to-someone-who-understands-only-the-mean
I would like to recreate this sort of graphical illustration in R, but I'm not sufficiently familiar with R's plotting tools. I don't even know where to start in order to get those colored rectangles between each pair of data points, let alone make them semi-transparent.
I think this could make a very efficient teaching tool.
The cor.rect.plot function in the TeachingDemos package makes plots similar to what is shown. You can modify the code for the function to make the plot even more similar if you desire.

beesel function i want to plot acoustic wave in terms of pressure vs x

C1*Bessel J(0, (500/166203941)*sqrt(-Pi)*sqrt(-1828243351+332407882*x))+C2*Bessel Y(0, (500/166203941)*sqrt(-Pi)*sqrt(-1828243351+332407882*x))
upper one is my solution through maple
i want to plot it please help i hv to submit my assignment.
See this page for basics on plotting with Maple http://www.math.sunysb.edu/~scott/Book331/Plotting_with_Maple.html
First and second kind Bessel functions you need are available as built-ins in Maple: http://www.maplesoft.com/support/help/Maple/view.aspx?path=Bessel
You need to specify the plot range for x, by the way.

Hyperellipsoid confidence region

The R function ellipse() (package: ellipse) allows to generate the coordinates of confidence regions for two parameters. Does anyone know how to generate the coordinates of hyperellipsoid confidence regions for D>2 parameters?
If I understand your question, I think what you want is described in the "Introduction to rggobi" document which you can find with a search. They call it a graphical manova. I implemented it in 3D in the function makeEllipsein the package ChemoSpec. If you study that and related functions, I think you can extend it to more dimensions. You can see it in action by running the examples in plotScores3D or plotScoresRGL. Good luck.

How to plot a set of densities in 3D using R?

I need to plot, in 3D, a set of densities associated to a time series. More precisely, I would like to be able in R to build an image close to this example
This image is taken from [1]. The transparency plays an important role as let us see the trajectory of the "measures" in the x-y plane.
Any help will be greatly appreciated.
[1]: Juban and Kariniotakis, "Uncertainty Estimation of Wind Power Forecasts", presentation at EWEC 2008 - 01 April - Brussels, Belgium. (I can't post the link, google will help interested readers).
In 1996 I wrote a paper (published in JCGS) with a figure very similar to that but without the transparency. See http://robjhyndman.com/papers/estimating-and-visualizing-conditional-densities/ for the details. The plotting function is implemented in the R package hdrcde available on CRAN. The package contains some examples in the help files. You should be able to adapt my code to add the transparency.
This is how far I got thanks to Rob's hint. I used persp() to create an empty plot and added polygons and lines to it:
However, it is not as pretty as the original one... :(

Resources