How to define different colors for different edges?

4 次查看(过去 30 天)
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

采纳的回答

Image Analyst
Image Analyst 2023-4-6
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 个评论
BLP
BLP 2023-4-11
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?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Geometry and Mesh 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by