3D Scatter with different Z axis vector length (2024)

8 views (last 30 days)

Show older comments

Haris Hameed on 6 Oct 2020

  • Link

    Direct link to this question

    https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length

  • Link

    Direct link to this question

    https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length

Commented: Haris Hameed on 7 Oct 2020

Accepted Answer: Adam Danz

Open in MATLAB Online

i have x and y data of size (100,1), and this data is for a specific number

x = lhsdesign(100,2);

R = 1000:1000:6000;

scatter3(x(:,1),x(:,2),R)

now i want to plot this in 3d scatter. please guide.

it is just like for each R there is an 100 size vector of x and y.

10 Comments

Show 8 older commentsHide 8 older comments

Haris Hameed on 6 Oct 2020

Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#comment_1040531

  • Link

    Direct link to this comment

    https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#comment_1040531

i want somthing like this

3D Scatter with different Z axis vector length (3)

Adam Danz on 6 Oct 2020

Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#comment_1040541

  • Link

    Direct link to this comment

    https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#comment_1040541

How should 6 values of R be mapped onto 100 values of x and y?

You probably just need to use repelem or repmat but it's unclear how the R values should be assigned.

Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#comment_1040551

  • Link

    Direct link to this comment

    https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#comment_1040551

can we somehow plot the x y scatter in layers ??

Adam Danz on 6 Oct 2020

Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#comment_1040756

  • Link

    Direct link to this comment

    https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#comment_1040756

Sure, but what defines the layers?

I know what x is. I don't know what z should be and I don't know what you want to do with R.

Haris Hameed on 7 Oct 2020

Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#comment_1040941

  • Link

    Direct link to this comment

    https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#comment_1040941

X and Y are random numbers. These are actually sample points. And R is the value at which these samples calculated. Advancing R we get set of X and Y data points. So R is the layer number where i want to plot X and Y.

Adam Danz on 7 Oct 2020

Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#comment_1040946

  • Link

    Direct link to this comment

    https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#comment_1040946

"R is the value at which these samples calculated"

That's where my understanding falls off a cliff. How are 100 random numbers calculated from 6 R values?

If you want a 3D plot, each (x,y) value needs a z value and it's unclear what those z values should be. We need 100 of them.

How should the 100 (x,y) values be distributed across 6 layers?

Haris Hameed on 7 Oct 2020

Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#comment_1040966

  • Link

    Direct link to this comment

    https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#comment_1040966

For example R is the section position on a wing surface (y/b). And at each section we get the values of cp, x, y, temp etc.

Adam Danz on 7 Oct 2020

Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#comment_1040971

  • Link

    Direct link to this comment

    https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#comment_1040971

How do I know what section x(5,:) comes from, for example? What about x(92,:) - what section/level/R is that from?

Haris Hameed on 7 Oct 2020

Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#comment_1040996

  • Link

    Direct link to this comment

    https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#comment_1040996

The sample point is stored for each R. X(92,:,5) so this x is for section 5. For each section (layer) we have 100 data points.

Adam Danz on 7 Oct 2020

Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#comment_1041016

  • Link

    Direct link to this comment

    https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#comment_1041016

ah.... there we go. Check back in a bit.

Sign in to comment.

Sign in to answer this question.

Accepted Answer

Adam Danz on 7 Oct 2020

  • Link

    Direct link to this answer

    https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#answer_507001

  • Link

    Direct link to this answer

    https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#answer_507001

Open in MATLAB Online

I don't know how you're storing the variables but the demo below should get you started.

It loops through values of R and you'll need to add the part that extracts the x and y values; for now it just uses the same (x,y) values.

x = lhsdesign(100,2);

R = 1000:1000:6000;

figure()

axes()

hold on % important

view(3)

grid on

for i = 1:numel(R)

% get x values

% x = ???

% y = ???

scatter3(x(:,1),x(:,2), repelem(R(i),numel(x(:,1)),1));

end

view([45,5]) % so you can see the layers (try view([90,0]) too)

3D Scatter with different Z axis vector length (14)

1 Comment

Show -1 older commentsHide -1 older comments

Haris Hameed on 7 Oct 2020

Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#comment_1041286

  • Link

    Direct link to this comment

    https://www.mathworks.com/matlabcentral/answers/606531-3d-scatter-with-different-z-axis-vector-length#comment_1041286

Yes exactly, thank you... really appreciate

Sign in to comment.

More Answers (0)

Sign in to answer this question.

See Also

Categories

MATLABGraphics2-D and 3-D PlotsData Distribution PlotsScatter Plots

Find more on Scatter Plots in Help Center and File Exchange

Tags

  • scatter
  • plot

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

An Error Occurred

Unable to complete the action because of changes made to the page. Reload the page to see its updated state.


3D Scatter with different Z axis vector length (16)

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom(English)

Asia Pacific

Contact your local office

3D Scatter with different Z axis vector length (2024)

FAQs

How to interpret a 3D scatterplot? ›

If the markers are close to making a straight line in any direction in the three-dimensional space of the 3D scatter plot, the correlation between the corresponding variables is high. If the markers are equally distributed in the 3D scatter plot, the correlation is low, or zero.

How do you tell if a scatter plot is strong or weak? ›

The strength of a scatter plot is usually described as weak, moderate or strong. The more spread out the points are, the weaker the relationship. If the points are clearly clustered, or closely follow a curve or line, the relationship is described as strong.

How do you interpret the results of a scatter plot? ›

You interpret a scatterplot by looking for trends in the data as you go from left to right: If the data show an uphill pattern as you move from left to right, this indicates a positive relationship between X and Y. As the X-values increase (move right), the Y-values tend to increase (move up).

Which Plotly method is used to create a 3D scatter plot? ›

scatter_3d. In a 3D scatter plot, each row of data_frame is represented by a symbol mark in 3D space. data_frame (DataFrame or array-like or dict) – This argument needs to be passed for column names (and not keyword names) to be used.

What is the size of scatter3d? ›

Description. scatter3d(x,y,z) creates a scatter plot with markers at the locations specified by x , y , and z . The default type of the marker is a circle, the default color is "blue" and the default marker size is 36. This means the circle surrounding the marker has an area of 36 points squared.

What is the correct function to create a scatterplot using ggplot in R? ›

A Basic Scatterplot with ggplot2 in R uses dots to represent values for two different numeric variables and is used to observe relationships between those variables. To plot the scatterplot we will use we will be using the geom_point() function.

How to plot a 3D scatterplot? ›

Create Chart

After adding data, go to the 'Traces' section under the 'Structure' menu on the left-hand side. Choose the 'Type' of trace, then choose '3D Scatter' under '3D' chart type. Next, select 'X', 'Y' and 'Z' values from the dropdown menus. This will create a 3D scatter trace, as seen below.

What is a scatter plot with 3? ›

Unlike a classic XY scatter chart, a 3D scatter plot displays data points on three axes (x, y, and z) in order to show the relationship between three variables. Therefore, it is often called an XYZ plot.

What is a 3D response surface plot? ›

A 3D surface plot is a three-dimensional graph that is useful for investigating desirable response values and operating conditions. A surface plot contains the following elements: Predictors on the x- and y-axes. A continuous surface that represents the response values on the z-axis.

Top Articles
Latest Posts
Article information

Author: Foster Heidenreich CPA

Last Updated:

Views: 6174

Rating: 4.6 / 5 (56 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Foster Heidenreich CPA

Birthday: 1995-01-14

Address: 55021 Usha Garden, North Larisa, DE 19209

Phone: +6812240846623

Job: Corporate Healthcare Strategist

Hobby: Singing, Listening to music, Rafting, LARPing, Gardening, Quilting, Rappelling

Introduction: My name is Foster Heidenreich CPA, I am a delightful, quaint, glorious, quaint, faithful, enchanting, fine person who loves writing and wants to share my knowledge and understanding with you.