Is it possible to plot with WxMaxima a function defined on a surface of R^3?
The outcome I would like is to see the surface (say a sphere), colored according to the values that the function takes on it.
Thanks in advance.
Related
I use R and the spatstat package to create a density map of vessels' trajectories using the pixellate function (spatstat). I'm able to create a map and plot the trajectories density.
Now I would like to improve the design of my map and do something like the maps created by Niels Willems (Google Scholar). The image below give an example of what I'm looking to achieve. Do you know what I could do to get this kind of 3D effects ?
Thanks for your help,
Arnaud
If the original trajectories were represented as an object of class psp (line segment pattern) then you could have used spatstat::density.psp to compute this kind of smoothed image. But if you have already converted them to a pixel image using pixellate.psp (with pixel values that tell you how much trajectory length was in each pixel) then you could use spatstat::blur to get a smoothed image.
I have 2 sets of data for 3D plot. First is defined on scattered grid and consist of X-,Y-,Z-vector, the second is defined on structured grid, consist of X-,Y-,Z-matrix and is obtained by interpolation of the first.
How do I plot surface of the second and points of the first inside of one 3d plot?
There are many solutions on the web, such as:
http://digital.ni.com/public.nsf/allkb/0ABACC8B023C15D3862572ED0070E4A6
https://decibel.ni.com/content/docs/DOC-4271
https://decibel.ni.com/content/docs/DOC-4585
You can go over and find the one which matches to your problem
I have a set of data that I'm trying to create a surface plot of. I have an x,y point and a to colour by.
I can create a xy plot with the points coloured but I can't find a way to create a surface plot with my data. The data isn't on a normal grid and I would prefer to not normalize it if possible (or I could just use a very fine grid).
The data won't be outside the a radius=1 circle so this part would need to be blank.
The code and the plot is shown below.
I've tried using contour, filled.contour as well as surface3d (not what I wanted). I'm not real familiar with many packages in R so I'm not even sure where to begin looking for this info.
Any help in creating this plot would be appreciated.
thanks,
Gordon
dip<-data.frame(dip=seq(0,90,10))
ddr<-data.frame(ddr=seq(0,350,10))
a<-merge(dip,ddr)
a$colour<-hsv(h=runif(nrow(a)))
degrees.to.radians<-function(degrees){
radians=degrees*pi/180
radians
}
a$equal_angle_x<-sin(degrees.to.radians(a$ddr))*tan(degrees.to.radians((90-a$dip)/2))
a$equal_angle_y<-cos(degrees.to.radians(a$ddr))*tan(degrees.to.radians((90-a$dip)/2))
plot(a$equal_angle_x,a$equal_angle_y,col=a$colour,lwd=10)
With regards to the plot I was trying to create is below. I believe the link in the first comment should get me where I'm trying to go.
I just discovered ggmap and I've been playing around with plotting earthquake data from the USGS. I get the data in the form of Lat and Lon, depth and magnitude. I can easily plot the earthquakes as points with different colors based on depth but what I would like to do is take that depth data (just a single number) and generate contours to overlay on the map.
This seems like it should be MUCH more simple than the "Houston Crime" example I keep coming up on since I'm not doing any statistical "density" calculation or anything like that. Basically it's just a contour map on top of the google map of an area.
How do I do this (Presumably) simple, simple thing?
Thanks!
The problem of plotting a 3D surface using only a small sample of unequally spaced lat/long points and a height z (or equivalent) variable is non-trivial -- you have to estimate the values of z for all of the lat-long grid coordinates you do not have, for example using loess() or kriging to create a smooth surface.
Take a look at Methods for doing heatmaps, level / contour plots, and hexagonal binning, case #5. For a geoR example see http://www4.stat.ncsu.edu/~reich/CUSP/Ordinary_Kriging_in_R.pdf
Is it possible to plot the following function with R?
$$\lim\limits _{x\to3^{+}}\, f(x)=2$$
$$\lim\limits _{x\to3^{-}}\, f(x)=1$$
Basically, I would like to see a plot with 2 curves. If possible how to make some circle (black or white) at the end of the curves... ?
Thank you
Define a piecewise continuous function:
ff <- function (xx) ifelse(xx<3,xx,xx+1)
Plot the first part of it, reserving enough space to plot the rest:
curve(expr=ff,from=0,to=2.999,xlim=c(0,6),ylim=c(0,7),xlab="",ylab="")
Add the second part:
curve(expr=ff,from=3,to=6,add=TRUE)
Add a little open circle:
points(3,ff(3),pch=21,bg="black")
Result: