how get graph?

4 ビュー (過去 30 日間)
huda nawaf
huda nawaf 2012 年 4 月 20 日
回答済み: Christine Tobler 2019 年 11 月 22 日
hi if I have data show users nd the relationships with other users, are there any way by which can draw such graph?
thanks in advance, huda

回答 (3 件)

Image Analyst
Image Analyst 2012 年 4 月 20 日
I think you should know this, but I'll just throw out a wild guess: a scatter plot? If that's not what you want then you need to be more descriptive. These may help with that:
The "gray level co-occurrence matrix" (performed by the graycomatrix function in the Image Processing Toolbox) is one way of seeing relationships such as this where you want to see the relationship between every item and every other item. It's an image of "connection weights" though (like how many times those items occur together as a pair), rather than a graph-theory type of node diagram. It may or may not be helpful to you, since I tend to look at things through "imaging glasses." For example:
% Create sample data.
m = uint8([1,100;1,3;1,10;2,100;3,2;3,4])
% Computer glcm matrix.
gcm = graycomatrix(m, 'numlevels', 255)
imshow(gcm, []);
axis on;
title('Gray Level Co-occurrence Matrix', 'Fontsize', 30);
xlabel('Column 1 Value', 'Fontsize', 30);
ylabel('Column 2 Value', 'Fontsize', 30);
% Enlarge figure to full screen.
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
glcm is like a scatterplot where the intensity of the dots depends on the frequency of occurrence of that pair.

Walter Roberson
Walter Roberson 2012 年 4 月 20 日
This sounds like a traditional kind of graph-theory plot. Unfortunately once you get to about 6 nodes, you cannot necessarily draw the result as a planar graph, so you are going to have to be more specific about how you want the graphs drawn.
  13 件のコメント
Geoff
Geoff 2012 年 4 月 23 日
Sounds like the required solution to this problem is to write a program which generates a GraphViz script, then install GraphViz and run the script.
huda nawaf
huda nawaf 2012 年 4 月 24 日
thanks for advice,
i did but with gephi software, no need a script

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


Christine Tobler
Christine Tobler 2019 年 11 月 22 日
Since MATLAB R2015b, there are Graph and Network Algorithms in MATLAB that will allow you to construct and plot a graph of these relationships. Several layout options are available, using plot(mygraph, 'Layout', 'force'), for example.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by