How to define different colors for different edges?

조회 수: 6 (최근 30일)
BLP
BLP 2023년 4월 6일
댓글: BLP 2023년 4월 11일
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