'MarkerEdgeColor' for Graph/Digraph Nodes

23 ビュー (過去 30 日間)
James Wright
James Wright 2022 年 8 月 1 日
回答済み: Christine Tobler 2022 年 8 月 2 日
Hello,
I am trying to find a way to apply borders to nodes in a graph to make them look more professional (I have already changed thier color). The 'MarkerEdgeColor' property used for normal plots does not seem to be applicable. Thank you in advance.
  3 件のコメント
James Wright
James Wright 2022 年 8 月 1 日
Yes, changing the color and shape of the nodes is simple enough but I can not find a way to outline the nodes for exmple adding a black border around a shape to make it more defined? Do you have any suggestions?
Walter Roberson
Walter Roberson 2022 年 8 月 1 日
I see that there is a NodeCData property, so possibly you could just fill in a blob. But I do not see any obvious alpha information for that. And I don't know that the label will be drawn on top or if it would cover the label .

サインインしてコメントする。

回答 (1 件)

Christine Tobler
Christine Tobler 2022 年 8 月 2 日
Yes, MATLAB's graph and digraph plots only have one NodeColor property which applies to both the marker's FaceColor and EdgeColor.
The easiest might be to turn off the markers of the GraphPlot object completely and add a scatter plot in which you would be able to set these properties directly for each node. The x- and y- data for the markers on the scatter plot could be taken from the XData and YData properties of the GraphPlot object that's returned from the plot function on a graph.

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by