Syntax
h=PLplot(PL,[c,w,vec,a])
Input Parameter
PL : | | Point list of x/y coordinates nx2 |
c : | | Color and symbol of points |
w : | | Width of the used line |
vec : | | if v>0, vectors are plotted from the origin |
a : | | transparancy; default is 0; |
Output Parameter
Examples
PLplot(PLcircle(10),'b-',4,'',0.9);
Copyright 2013-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)
This function, PLplot, is designed to plot point lists, specifically closed polygon lists, in a 2D space using MATLAB. It is part of the SolidGeometry library.
Input Parameters
- PL: A matrix representing the point list to be plotted. Each row corresponds to a point.
- c: (Optional) A string specifying the color and style of the plot. Default is 'r*-' (red with star markers and solid line).
- w: (Optional) A scalar specifying the line width. Default is 1.
- vec: (Optional) A boolean indicating vector mode. If true, each point is plotted as a vector from the origin. Default is false (0).
- a: (Optional) A scalar for alpha transparency. Default is 0 (no transparency).
Output
- h: A handle to the plot, which can be used for further customization or manipulation.
Algorithm Steps
- Check if the point list
PL
is empty. If so, return an empty handle.
- If
PL
has three columns, issue a warning suggesting the use of VLplot
instead, to avoid faulty drawings.
- Set default values for optional parameters
c
, w
, vec
, and a
. Override these defaults if corresponding arguments are provided.
- Ensure the point list
PL
contains real numbers.
- Initialize an empty handle
h
.
- Check the
vec
parameter:
- If
vec
is 0, plot the points as a simple vertex list using plot3
, with the z-coordinate set to zero.
- If
vec
is true, plot each point as a vector from the origin using a loop and the lplot
function.
- If
a
is greater than 0, call CPLfaceplot
to add transparency to the plot.
Algorithm explaination created using ChatGPT on 2025-08-19 07:30. (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