changing angle in 3d scatterplot? - r

I drew a 3D scatterplot in R which is a flat surface.
But the plot does not clearly show what it looks like, so I'd like to change the angle to see this plot at a different viewpoint.
How can I do this?

Related

Plotting three-dimensional vector field as coherent structures using Matlab

I have a three-dimensional vectorfield containing of coherent structures in the form of counter-rotating circles.
I would like to show these structures three-dimensionally.
So far I have used contour() in order to plot the strucutres on the y,z plane as shown in the figure below, where circles of constant magnitude are plotted.
Now I would like to plot these circles three-dimensionally, this would result in the circles being tilted in the direction of the viewer as one can see from the next plot.
How would I be able to plot such three-dimensional strucutres, where the circles are tilted in the direction of the viewer?
Functions as isosurface() do not seem to help.
I would very much appreciate any kind of help.
I have tried various functions such as isosurface(), quiver3() and streamtube() however I am not able to show the plot I am interested in: a single slice of circles being tilted in the direction of the viewer shown in a three-dimensional plot.

Make a cubic box in 3d scatter plot in Octave

I have made the following figure in Octave using the scatter3 function.
I would like to draw the rest of the sides of the cube in the plot (the lines x=0,y=0, z=20,x=0 etc). How to do this?
plot3([0,0],[0,0],[0,20],'linewidth',2,'k')
Draws a line between (0,0,0) and (0,0,20). Make such lines for all the sides.

Define the plotting area of an igraph plot

I'm trying to plot igraph objects for which I have set the xy coordinates.
It's been working fine, but when the plot is produced it is stretched in either the x or y so the network looks distorted.
Does anyone know a way that I can define the plotting area (i.e. tell igraph that I want it to plot on a square of set dimensions)? Or any other way of avoiding this problem?

Simple Contour map

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

R- xy scatter plot in 3d using density

I want to visualize an x-y scatter in 3d, using the density/overlaps as z values. I guess this would be like using alpha as a z-axis - more overlap = higher z. Suggestions? Perhaps using cloud() in lattice library?
I use rgl for 3D visualization. You can rotate the image in rgl window using your mouse. Wheel zooms in/out.
example(plot3d)
rgl.bg(color = "black") # Space, the final Frontier.
There are a variety of 2d density functions available:
MASS::kde2d
fields::smooth.2d
hexbin::hexbin
In general visualizing 3d clouds of points is rather difficult. Pseudo 3d with surfaces is ok but the points do not display with sufficient depth cues. If you really want to try it, then use the rgl package so you can rotate.

Resources