フィルターのクリア

Plotting two digraphs on the same plot

5 ビュー (過去 30 日間)
Emil Mathew
Emil Mathew 2018 年 5 月 28 日
回答済み: Shrestha Kumar 2018 年 5 月 28 日
Hi, I have to plot and represent a bipartite network in such a way that there are two adjacency matrices, one which deals with the connection between partitions and one that deals with connections within the partition. For now, I'm taking each of the two partitions to have 2 nodes but later on, I want to generalize to a larger number of nodes. I have the two graphs but I'm not able to plot them together. This is what my code looks like:
G = digraph(1,2,1)
F = digraph([1 1 2 2],[3 4 3 4],[1 1 1 1])
f = plot(F,'EdgeColor','r')
h = plot(G,'EdgeColor','r')
I'm new to representing graphs on MATLAB. Any help is appreciated. Thank you!

採用された回答

Shrestha Kumar
Shrestha Kumar 2018 年 5 月 28 日
Hi,
After you plot the f graph use "hold on" to plot another graph on the same display.
f=plot(F,'EdgeColor','r')
hold on
h = plot(G,'EdgeColor','r')
This will do the job.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNetworks についてさらに検索

製品


リリース

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by