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 7849675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:36:11+00:00 2026-06-02T18:36:11+00:00

I am using plot3d(x,y,z, col=test$color, size=4) to plot a 3d scatterplot of my dataset

  • 0

I am using

plot3d(x,y,z, col=test$color, size=4) 

to plot a 3d scatterplot of my dataset with R, but with rgl the size argument only takes one size.

Is it possible to have different sizes for each data point, perhaps with another library, or is there a simple workaround?

Thanks for your ideas!

  • 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-06-02T18:36:12+00:00Added an answer on June 2, 2026 at 6:36 pm

    Here’s a work-around along the same lines suggested by Etienne. The key idea is to set up the plot, then use a separate call to points3d() to plot the points in each size class.

    # Break data.frame into a list of data.frames, each to be plotted 
    # with points of a different size
    size <- as.numeric(cut(iris$Petal.Width, 7))
    irisList <- split(iris, size)
    
    # Setup the plot
    with(iris, plot3d(Sepal.Length, Sepal.Width, Petal.Length, col=Species, size=0))
    
    # Use a separate call to points3d() to plot points of each size
    for(i in seq_along(irisList)) {
        with(irisList[[i]], points3d(Sepal.Length, Sepal.Width, 
                                     Petal.Length, col=Species, size=i))
    }
    

    (FWIW, it does appear that there’s no way to get plot3d() to do this directly. The problem is that plot3d() uses the helper function material3d() to set point sizes and as shown below, material3d() only wants to take a single numeric value.)

    material3d(size = 1:7)
    # Error in rgl.numeric(size) : size must be a single numeric value
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the plot3d function to make a 3d plot in my R
All the three variables I am using to plot are matrix of size 1x1x100
Using Nunit, I want to be able to write a test fixture that will
Using top it's easy to identify processes that are hogging memory and cpu, but
I would like to plot results from a MDS analysis with 3 dimensions using
Using the navigator.geolocation object in JavaScript. Trying to establish accurate ranges, but wondering exactly
Using jQuery, one can easily find out whether a particular element is visible using
I have 4 dimensions of data. In R, I'm using plot3d with the 4th
Using mercurial, I've run into an odd problem where a line from one committer
I'm writing a simple Mathematica implementation of the black-scholes model and using Plot3D to

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.