pplot
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Visualization
Introduced first in SolidGeometry 1.0, Creation date: 2010-08-06, Last change: 2025-09-14
pplot shows a 3D-plot figure of a point or a list of points
Description
p is a list 2xn or 3xn
See Also: aplot
, lplot
, tfplot
, tlplot
, slplot
, plotTP
, plotL
, plotT
Example Illustration
Syntax
h=pplot(p,[c,w])
Input Parameter
p: | | Point or list of points to be plotted 2xn or 3xn |
c: | | Color and symbol of points |
w: | | width of the used line |
Output Parameter
References
- Kerle, H., Pittschellis, R. Corves, B. (2007): Einführung in die Getriebelehre, B.G. Teubner Verlag, 3. Auflage
Copyright 2010-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
Input Parameters:
- p: A point or list of points to be plotted. It can be a 2xn or 3xn matrix, where n is the number of points.
- c: (Optional) A string specifying the color and symbol of the points. Default is 'r*-' (red stars with lines).
- w: (Optional) A scalar specifying the width of the line used in the plot. Default is 1.
Output:
- h: Handle to the figure created by the plot.
Algorithm Steps:
- Check if the input
p has exactly 2 elements. If so, convert it to a 3-element column vector by appending a zero: p = [p(1); p(2); 0].
- If
p is a 2xn matrix, convert it to a 3xn matrix by appending a row of zeros: p = [p; zeros(size(p,2),1)'].
- Set the default color and symbol
c to 'r*-' if not provided.
- Set the default line width
w to 1 if not provided.
- Use the
plot3 function to create a 3D plot of the points in p:
- If
w is 1, call plot3(p(1,:), p(2,:), p(3,:), c).
- If
w is not 1, call plot3(p(1,:), p(2,:), p(3,:), c, 'LineWidth', w).
- Return the handle
h to the created plot.
Algorithm explaination created using ChatGPT on 2025-08-19 00:35. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21