How to define different colors for different edges?

6 vues (au cours des 30 derniers jours)
BLP
BLP le 6 Avr 2023
Commenté : BLP le 11 Avr 2023
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

Réponse acceptée

Image Analyst
Image Analyst le 6 Avr 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 commentaire
BLP
BLP le 11 Avr 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?

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by