How to define different colors for different edges?

6 views (last 30 days)
Hello evrybody,
I have an electrostatis pde model with the geometry ilustrated below (pdegplot, "EdgeLebals"=="off", 16 edges). I am wandering if there is any way to define line colors for the edges? I have checked in the Property Inspector, that the plot consists only one line object for the model geometry.
Thanks for any help,
Beata

Accepted Answer

Image Analyst
Image Analyst on 6 Apr 2023
If you can get the coordinates of the line endpoints, you can use the line function to overwrite that shape with colors of your choice.
help line
LINE Create line LINE(X,Y) adds the line defined in vectors X and Y to the current axes. If X and Y are matrices of the same size, line draws one line per column. LINE(X,Y,Z) creates lines in three-dimensional coordinates. LINE('XData',x,'YData',y,'ZData',z,...) creates a line in the current axes using the Name,Value pairs as arguments. This is the low-level form of the line function, which does not accept matrix coordinate data as the other informal forms described above. LINE(...,Name,Value) specifies line properties using one or more Name,Value pair arguments. LINE(container,...) creates the line in the axes, group, or transform specified by container, instead of in the current axes. H = LINE(...) returns a column vector of the primitive line objects created. Execute GET(H), where H is a line object, to see a list of line object properties and their current values. Execute SET(H) to see a list of line object properties and legal property values. See also PATCH, TEXT, PLOT, PLOT3. Documentation for line doc line
  1 Comment
BLP
BLP on 11 Apr 2023
Thanks, I thought about this but hoped, there is another way using the pdegplot function. With the line function I need to know which Vertex is an endpoint of wich Edge. I created the shape as a superposition of rectangles. Mayby it would be better to define it as a parametric curve?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!