MATLAB: 3D plots- How to plot 3D lines rather than surface?

In summary, the conversation is about using meshgrid and mesh in MATLAB to plot 3D graphs. The person is looking for a way to obtain discrete lines instead of a surface plot, and someone suggests using plot3() or looking into different plots in graph3d.
  • #1
hanson
319
0
Hi all.
I am using meshgrid and mesh to plot 3D graphs in MATLAB.
Though my meshgrid is quite "discrete", MATLAB always try to generate surface for me.
What I actually want is some discrete lines rather than the surface.
Anyone can teach me how to obtain discrete lines?
 
Physics news on Phys.org
  • #2
I'm not quite sure what you want...
Try looking at graph3d for the different plots.
Perhaps waterfall is what you want?
 
  • #3
hanson said:
Hi all.
I am using meshgrid and mesh to plot 3D graphs in MATLAB.
Though my meshgrid is quite "discrete", MATLAB always try to generate surface for me.
What I actually want is some discrete lines rather than the surface.
Anyone can teach me how to obtain discrete lines?

you can use plot3() to draw 3d lines.
but I'm not sure what you really want!
 

What is MATLAB and how does it work?

MATLAB is a high-level programming language commonly used in scientific computing. It allows users to perform various numerical calculations, create visualizations, and manipulate data. MATLAB works by executing commands in the command window or by creating scripts and functions.

What is a 3D plot in MATLAB?

A 3D plot in MATLAB is a visual representation of three-dimensional data. It can be created using different types of plots such as scatter plots, line plots, or surface plots. These plots allow for a better understanding of complex data and relationships between variables.

How do I plot 3D lines in MATLAB?

To plot 3D lines in MATLAB, you can use the plot3 function. This function takes in three vectors as input, representing the x, y, and z coordinates of the points to be plotted. You can also customize the appearance of the lines by specifying different parameters, such as color and line style.

Can I add labels and titles to a 3D plot in MATLAB?

Yes, you can add labels and titles to a 3D plot in MATLAB to provide context and make it more informative. To add labels, you can use the xlabel, ylabel, and zlabel functions. To add a title, you can use the title function.

Are there any other types of 3D plots available in MATLAB besides lines and surfaces?

Yes, there are other types of 3D plots available in MATLAB, such as scatter plots, bar graphs, and contour plots. These plots can be created using different functions and can be useful for different types of data and analysis.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
737
Back
Top