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

  • SEARCH
  • Home
  • 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 4035464
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:06:05+00:00 2026-05-20T12:06:05+00:00

I recently started using R language and now i am using R for most

  • 0

I recently started using R language and now i am using R for most of my 2d plots. Now, I want to use R for generating 3d plots. I have x, y, z data coming from a tool, till now i was using splot in gnuplot to generate a surface plot. I want to use R for generating a surface plot similar to the one splot in gnuplot gives. Problem i see is, to generate a 3d plot R requires data to be in matrix format but my data is not in that format. My question is, if gnuplot is able to generate a plot from the data why R cant do it. I am sure i am missing something, please help me

Here is the plot from gnuplot

Surface plot from GNU plot

This is the data

17.46 537.74 0.8
18.36 537.74 1.6
19.26 537.74 1.3
19.395 537.74 1.7
21.015 537.74 1.9
35.46 475.26 1.2
36.36 475.26 0.8
37.395 475.26 0.9
39.96 475.26 0.6
43.56 475.26 1
  • 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-20T12:06:06+00:00Added an answer on May 20, 2026 at 12:06 pm

    It’s no secret that I’m a raster package fan. It comes with a plot method that uses rgl package. The images can be quite the eye-full.

    This is is the example from ?raster::plot3D
    enter image description here

    EDIT

    Here’s an example of how to plot a surface using a matrix with three columns. This example looks like stage death trap in Mortal Combat. If you’re looking for kernel smoothing, then that merits its own question.

    library(rgl)
    library(raster)
    x <- sample(-500:500, 1000, replace = TRUE)
    y <- sample(-500:500, 1000, replace = TRUE)
    z <- rnorm(500, 10, 20)
    df <- cbind(x, y, z)
    
    rst <- raster(ncols = 100, nrows = 100, xmn = -100, xmx = 100, ymn = -100, ymx = 100)
    rst2 <- rasterize(x = df[,1:2], y = rst, df[, 3])
    plot3D(rst2)
    

    enter image description here

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

Sidebar

Related Questions

I have recently started using Vim as my text editor and am currently working
I recently started using Eclipse at work for my Java servlet projects. I've been
We recently started using maven for dependency management. Our team uses eclipse as it's
I recently started using scons to build several small cross-platform projects. One of these
I recently started using Git as my version control system for some Cocoa projects
I recently started using Linux as my primary OS. What are the tools that
I've recently started using Eclipse Ganymede CDT for C development and I couldn't like
I've recently started using code coverage tools (particularily Emma and EclEmma), and I really
I've recently started using it. However, after running it against one of my company's
My company has recently started using Scrum; we've done 2 sprints. We're still learning,

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.