How to color a graph that is shown below?
이전 댓글 표시
I have graph below that was generated by the following code:
Also the data.xlsx has the matrix used below.
nodes = [];
new_matrix(:,1:2) = matrix(:,1:2);
for i = 1:1:size(matrix,1)
if matrix(i,4) <= 10000
nodes = [nodes,matrix(i,1:2)];
% new_matrix(i,1:2) = 0;
new_matrix(i,3) = 1;
else
% new_matrix(i,1:2) = 0;
new_matrix(i,3) = 0;
end
end
%
nodes_cellarray{:} = nodes;
set(figure, 'Visible', 'on');
G = graph(matrix(:,1),matrix(:,2));
plot_array = plot(G, 'layout', 'auto');
% plot_array.NodeColor = 'white';
highlight(plot_array,nodes_cellarray{:},'EdgeColor','r','NodeColor','red','LineWidth',4);
I get a graph plot as shown here:

I am aiming to color this graph such that it should look like the colorplot below:

This is a MATLAB generated plot from a research artcle.
댓글 수: 15
Walter Roberson
2020년 1월 1일
The bottom appears to be an colormapped image.
I am concerned that you might perhaps be getting confused about what "graph()" means to MATLAB. graph() in MATLAB is not a plot: it is a data entity in the "Graph Theory" sense of nodes and edges and paths. Graphs in the Graph Theory sense are abstract topological constructs, and have no inherent visual display and no inherent dimensionality. A Graph is not an image and a Graph is not a map.
Jay Vaidya
2020년 1월 1일
Walter Roberson
2020년 1월 2일
I have looked at the file. I cannot see any way that the data contained there could be turned into that plot.
Jay Vaidya
2020년 1월 3일
Walter Roberson
2020년 1월 3일
No, I do not think that would be helpful.
If we interpret the first two columns to be coordinates, then there are three kinds of values in the file:
- values along the strict diagonal x = y
- values along the 52'nd diagonal, second column = first column + 51
- either of the above, but the data values are both exactly 65535
The only way I have been able to interpret the 65535 values is as indicating "missing data".
For most of the file, the missing-data values occur exactly 4 entries apart. This corresponds to broken 52'nd diagonal, with the pattern "value on main diagonal" then "value on diagonal 52 at same first coordinate", then "value on main diagonal at next coordinate", then "missing value on diagonal 52 at next coordinate".
With the main and 52'nd diagonal being exactly 1 and well seperated, there is no hope of getting the kind of graph you show at the bottom.
Heat map is not applicable to this situation because the coordinates are never exactly the same.
You might hypothesize that perhaps coordinates need to be grouped together, several in a row being binned together, but the problem with this hypothesis is that the two diagonals are strict, and any blocking would be the same thin region, except near the beginning of the file (pattern is slightly different in the beginning of the file.)
You could create connectivity graphs, but all they are going to show is the diagonal line for the main diagonal, and isolated unconnected dots on the 52'nd diagonal.
Jay Vaidya
2020년 1월 3일
Walter Roberson
2020년 1월 3일
It would help if you were to document what the columns mean in the context of the paper.
Jay Vaidya
2020년 1월 3일
Walter Roberson
2020년 1월 3일
? Andrei Bobrov does not appear to have contributed to this topic (or you other closely related one) ?
Walter Roberson
2020년 1월 3일
This is starting to make more sense than it did before, and I am able to get a node plot, but I still don't see how to get anything close to that colormap graph.
Image Analyst
2020년 1월 3일
First Robert (earlier today), now Bobrov. Apparently the community is trying to tell you that they think Robert or a nickname of Robert is what you should be called.
Jay Vaidya
2020년 1월 3일
Jay Vaidya
2020년 1월 4일
Walter Roberson
2020년 1월 4일
편집: Walter Roberson
2020년 1월 4일
You have Node A as an integer, and given the node number and your numbering diagram, you can translate the node number into X and Y coordinates.
Likewise you have Node B that can be translated into X and Y coordinates.
But what does the Weight column convey ? You have an edge with finite value, and those edges are always either adjacent to each other horizontally or vertically, but what should be done with the weight value?
Like do the inf entries mark nucleation, and I should be plotting those as yellow instead of discarding them? If so then that would not agree with the pattern in the last part of the file, where every 4th entry is reliably inf.
Jay Vaidya
2020년 1월 4일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Orange에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




