Questions tagged [plot3d]

plot3D is a package for use with R that includes functions for visualizing 2-D and 3-D data, including perspective plots, slice plots, surface plots, and scatter plots.

plot3D is an R package that includes functions for visualizing 2-D and 3-D data. Many of the functions are extensions of R’s persp() or image() functions.

The package can be used to make 3D scatter plots, surface plots, slice plots, and to visualize oceanographic data.

Repositories

Vignettes

Related Packages

  • Package (also includes the plot3D() function)
  • Package (Plots a three dimensional (3D) point cloud.)
  • Package plot3Drgl (The 'rgl' implementation of plot3D functions.)
94 questions
4
votes
0 answers

R - Plot3D not showing axis during certain angle views

I'm trying to show a 3D graph from "one angle" where I should still see part of the y-axis. Currently because of the extreme angle, R automatically cuts out the y axis. However, I would like to keep this axis (labelled HC). I cannot find any…
Ragstock
  • 55
  • 8
4
votes
1 answer

Setting color range in persp3d() in R with plot3D

I'm really new to R and I want to create an Image like the one I added here, but I need to have the Color Range from 0 to 1, right now it's set automatically, in the image it is from 0.2 to 0.6. Here is my R code that I use. Mat.csv is a 2D Matrix…
Fadi
  • 43
  • 3
4
votes
1 answer

Aspect ratio in plot3D::persp3D in R

Anyone knows how to alter width-length aspect ratio of xy plane with plot3D package? For example, how to make x axis appear twice the length of y axis (without changing data values): plot3D::persp3D(z = volcano)
Oleg Melnikov
  • 3,080
  • 3
  • 34
  • 65
4
votes
0 answers

How to remove ticktypes with prespbox() (plot3d)

I am trying to construct a 3d-plot with grid lines using the function prespbox() and adding an additional plot of a figure based on some data using the surf3d() function. This is my code: library(plot3D) # added by comment perspbox (x = seq(0.05,…
Alia
  • 41
  • 2
4
votes
3 answers

How to plot a greek letter on a 3D plot label with hist3D()?

I am plotting a 3D histogram using hist3D(), and want to change xlab so that it includes a Greek letter with a subscript. I used xlab=expression(theta[1]). It doesn't work, and I just get the string "theta[1]" in the label. It works fine, on the…
kloop
  • 4,537
  • 13
  • 42
  • 66
3
votes
1 answer

How do you draw a partition plane from a classification algorithm in a 3D plot in R

I'm trying to draw a partition border from a classification algorithm in a 3D plot in R (using plot3D). It's a relatively simple task if we only have two predictors, requiring only two axes to draw (e.g. using the partimat function). I haven't yet…
Cai Ladd
  • 59
  • 8
3
votes
0 answers

How to include subscript in axis labels of a scatter3D plot in R

I want to make a scatter 3D Plot with PC_1 and PC_3 (subscripts) as labels of the x- and z-axis. I would usually do it with expression(PC[1]) but it doesn't work. I just can't find a way to solve the problem. library(plot3D) par(mar = c(4, 0, 3.2,…
Zerg
  • 31
  • 1
3
votes
1 answer

leaflet map: remove road layer

I want to remove roads from my leaflet map in R. Is there a way to remove layers we want such as roads, lakes, state boundaries, etc.? Sample code: library(leaflet) library(plot3D) top = 45 # north lat left = -110 # west long right = -90 #…
Fisseha Berhane
  • 2,533
  • 4
  • 30
  • 48
3
votes
1 answer

3D surface plot in R with plot3D or plotly

I want to produce a 3D surface in R where y is flux, x is Age and z is precipitation. I have a range of age between 0 and 152 and a range of precipitation 0 and 2600. I also have two functions where flux is function of Age or Precipitation: Flux=…
SimonB
  • 670
  • 1
  • 10
  • 25
3
votes
1 answer

Displaying multiple 3d plots in the same window using plot3D {rasterVis} in R

I am interested in making two 3d topographic plots that display side by side in the same Xquartz device window. Displaying two 3d plots in the same window is straightforward using the rgl package - there are plenty of examples in the documentation…
TPegan
  • 33
  • 3
3
votes
0 answers

Use slice3D() from package plot3D

I am trying to use the package plot3D to plot my xyz data with the color based on 4th variable. My data looks like this: data.frame(xx,yy,zz,Ammpl) xx yy zz Ammpl 1 63021.71 403105.0 1.181028516 1170 2 63021.71…
IlhameO
  • 35
  • 7
2
votes
1 answer

Problem of coloring 3D scatterplot using "plot3D"

I am trying to create a 3D scatter plot using plot3D package. Unfortunately I have a trouble in assigning color to each points. For example, when I try to draw 8 points on the plot and I want to assign "black" to first 4 points and "red" to last 4…
Hiro
  • 21
  • 1
2
votes
1 answer

How can I add a subscript to my axis label when using persp3D function in R?

I am trying to define my z-axis label as R0 in plot3D, below are my code, I am using expression for my zlab, but I get the result as in the image attached here. library(plot3D) lambda <- 1/12 sigma <- 0.4 gamma <- 0.4 beta <- 0.00007 c <-0.0034 m…
Ella Taib
  • 63
  • 4
2
votes
1 answer

Why doesn't kmeans find the 3 clusters?

I run a kmeans on a 3 dimensional dataset and get the following result: Code as followed: library(tidyr) setwd('C:/temp/rwd') getwd() df <- read.table('data-1581352459203.csv', header = TRUE, sep = ",") dff <-…
Francois
  • 851
  • 1
  • 7
  • 10
2
votes
1 answer

r - Force / edit axis values in plot3D

In my most recent question I faced a problem having to do with the axis when using a different library. In this particular case, I'm using the same dataset where the variable present in X has only two possible values - 2009 or…
molecoder
  • 423
  • 1
  • 7
  • 24
1
2 3 4 5 6 7