Shivid
Shivid

Reputation: 1343

Arbitrary placing on nodes (layers) in Matlab graph

The following code using hold on overlaps completely a graph on the other;

hold on
m = {'a'};
n = {'b'};
v = {'c'}; 
w = {'d'};
g1 = graph(m,n);
g2 = graph(v,w);
p1 = plot(g1);
p2 = plot(g2);
p1.NodeLabel = {'', ''};
p2.NodeLabel = {'', ''};
p2.LineStyle = {'none'};
p1.MarkerSize = [10 20];
p2.MarkerSize = [20 10];
axis off

enter image description here

in case I need visibility of both placed on nodes (like the lower nodes) is there any solution (or trick) instead of hold on?

Upvotes: 3

Views: 90

Answers (1)

Shivid
Shivid

Reputation: 1343

by the way so far this trick seems to be working;

dividing the total_matrix to the minor_matrix and major_matrix, and just put the major_matrix on first layer, then make NodeColor the variable.

enter image description here

Upvotes: 1

Related Questions