Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 489035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:46:04+00:00 2026-05-13T01:46:04+00:00

I have a 3-tuple data set (X,Y,Z points) that I want to plot using

  • 0

I have a 3-tuple data set (X,Y,Z points) that I want to plot using R.

I want to create a surface plot from the data, and superimpose a contour map on the surface plot, so as to create the impression of the contour map being the “shadow” or projection from the surface plot. The contour map is to appear below the surface plot.

My data set looks somewhat like this:

Axis  |  Data Type
-------------------
X     |  Date value
Y     |  Float value
Z     |  Float value

How can I achieve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T01:46:05+00:00Added an answer on May 13, 2026 at 1:46 am

    Edit:

    I just saw that you pointed out one of your dimensions is a date. In that case, have a look at Jeff Ryan’s chartSeries3d which is designed to chart 3-dimensional time series. Here he shows the yield curve over time:

    chartSeries example

    Original Answer:

    As I understand it, you want a countour map to be the projection on the plane beneath the 3D surface plot. I don’t believe that there’s an easy way to do this other than creating the two plots and then combining them. You may find the spatial view helpful for this.

    There are two primary R packages for 3D plotting: rgl (or you can use the related misc3d package) and scatterplot3d.

    rgl

    The rgl package uses OpenGL to create interactive 3D plots (read more on the rgl website). Here’s an example using the surface3d function:

    library(rgl)
    data(volcano)
    z <- 2 * volcano # Exaggerate the relief
    x <- 10 * (1:nrow(z)) # 10 meter spacing (S to N)
    y <- 10 * (1:ncol(z)) # 10 meter spacing (E to W)
    zlim <- range(z)
    zlen <- zlim[2] - zlim[1] + 1
    colorlut <- terrain.colors(zlen,alpha=0) # height color lookup table
    col <- colorlut[ z-zlim[1]+1 ] # assign colors to heights for each point
    open3d()
    rgl.surface(x, y, z, color=col, alpha=0.75, back="lines")
    

    The alpha parameter makes this surface partly transparent. Now you have an interactive 3D plot of a surface and you want to create a countour map underneath. rgl allows you add more plots to an existing image:

    colorlut <- heat.colors(zlen,alpha=1) # use different colors for the contour map
    col <- colorlut[ z-zlim[1]+1 ] 
    rgl.surface(x, y, matrix(1, nrow(z), ncol(z)),color=col, back="fill")
    

    In this surface I set the heights=1 so that we have a plane underneath the other surface. This ends up looking like this, and can be rotated with a mouse:

    3D surface plot

    scatterplot3d

    scatterplot3d is a little more like other plotting functions in R (read the vignette). Here’s a simple example:

    temp <- seq(-pi, 0, length = 50)
    x <- c(rep(1, 50) %*% t(cos(temp)))
    y <- c(cos(temp) %*% t(sin(temp)))
    z <- c(sin(temp) %*% t(sin(temp)))
    scatterplot3d(x, y, z, highlight.3d=TRUE,
     col.axis="blue", col.grid="lightblue",
     main="scatterplot3d - 2", pch=20)
    

    In this case, you will need to overlay the images. The R-Wiki has a nice post on creating a tanslucent background image.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 231k
  • Answers 231k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Use the following function like this: Image('/path/to/original.image', '1/1', '150*', './thumb.jpg');… May 13, 2026 at 2:13 am
  • Editorial Team
    Editorial Team added an answer Check you database schema to see if the field (referenced… May 13, 2026 at 2:13 am
  • Editorial Team
    Editorial Team added an answer I figured out the problem - there was a session… May 13, 2026 at 2:13 am

Related Questions

I had encountered strange problem while construct a unordeed_set<tuple<int,int>> . I had tried VC++8,
I have some configuration data that I'd like to model in code as so:
Say I have a dataset like (1, 2, (3, 4), (5, 6), (7, 8,
I have a series of data points (tuples) in a list with a format
I have a data structure which is a collection of tuples like this: things

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.