2017-06-29 48 views
-1

我有一個包含了一組存儲在nodeNames節點的圖形G和I有兩個子圖A和G的乙如下:它只是一個較長的碼畫兩條子圖一起

G = digraph(adj,nodeNames); 
    h = plot(G); 
    v = dfsearch(G,'n'); 
    disp(v);        % v is a cell array that contains all the nodes are included in the path of n 
    A=subgraph(G,v);   % the first subgraph that contains the nodes that are included in the path of n 
    NoNodeAccess=setdiff(nodeNames,v); % NoNodeAccess is a cell array that includes all the remaining nodes that are not in the path of n 
    B=subgraph(G,NoNodeAccess); % the second subgraph. 

分區現在我想要一個包含兩個子圖的陰謀,我想通過線型區分它們,或者如果可能的話,單獨圈選每個子圖。怎麼做 ?感謝

回答

0

這個命令可以幫助在保持老圖來生成新的劇情:

hold on 

可以產生兩個數字之間添加此命令。基本上新的情節將有不同的顏色與前一個區分開來,並且您絕對可以使用情節屬性來更改線條類型和顏色。

https://www.mathworks.com/help/matlab/ref/plot.html