How to Create a 3D Plot in Matlab for Matrix Visualization?

In summary, the conversation discusses the need to produce a 3D plot for a matrix using Matlab, specifically including both alpha and beta values. The individual layers of the matrix represent different angles and the desired plot would be a stacked coloured scatter plot with a color bar scale for visualizing the angles. The use of scatter3 or quiver3 is suggested as a possible solution.
  • #1
katie_smith
1
0
Hi everyone,

I'm working on a project where I need to produce a 3D plot for matrix using Matlab. The plot must comprise of both alpha and beta in 3D. Alpha, A is a 320 x 333 x 4 matrix, where each individual layer (i.e. A(320,333,i) for i = 1:4) represents one image's angles. The beta matrix is similar.

I've searched around, but I can't find a way of doing such plots in Matlab anywhere. I can quite easily do a coloured plot in 2D but the 3D plot is the one needed for visualisation purposes. I wanted to do a stacked coloured scatter plot in 3D to form the image volume somehow. It would need to be a coloured scatter plot with a colour bar scale on the side so we can know what each colour represents angle-wise. Please, oh please if any of you could help me I would be forever grateful.

Katie x
 
Physics news on Phys.org
  • #2
Sorry, I'm not a Matlab user, but I wonder if scatter3 or quiver3 (particularly as you might be able to use arrows to show the angles) might provide a way of achieving what you want?
 

1. How do I create a 3D plot in Matlab?

To create a 3D plot in Matlab, you can use the plot3 function. This function takes in three arguments: x, y, and z, which represent the coordinates of the data points you want to plot. You can also customize your plot by adding a title, labels, and changing the color and style of the lines.

2. Can I plot multiple data sets on the same 3D plot in Matlab?

Yes, you can plot multiple data sets on the same 3D plot by using the hold on command after each plot3 function. This will prevent the previous plot from being erased and allow you to add more plots to the same figure.

3. How do I rotate and view my 3D plot from different angles in Matlab?

You can use the view function in Matlab to rotate and view your 3D plot from different angles. This function takes in two arguments: the azimuth angle and the elevation angle, which determine the direction from which you are viewing the plot.

4. Can I create a 3D surface plot in Matlab?

Yes, you can create a 3D surface plot in Matlab by using the surf function. This function takes in two arguments: X and Y, which represent the coordinates of the points on the x-y plane, and a third argument Z, which represents the height of the surface at each point.

5. How can I add a color bar to my 3D plot in Matlab?

To add a color bar to your 3D plot in Matlab, you can use the colorbar function. This will display a vertical bar on the side of your plot with a color scale, representing the range of values in your plot. You can also customize the color bar by changing the title, labels, and color limits.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
997
  • MATLAB, Maple, Mathematica, LaTeX
Replies
32
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
827
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
Back
Top