1
$\begingroup$

I am wondering if I can make a graph like that somehow: LDG Graph for a Chemical Process Industry

I am new to mathematica, I tried to play with Creating a graph with variable size of vertices and variable thickness of edges . I figured if I could get the data in that form I could make some changes and try to adapt it to mine. But that is not working.

Can someone help me please??

This is what the data sample looks like in tabulated form: enter image description here

I used this:

trans = Uncompress@
"1:eJxTTMoPShNkYGAoZgESPpnFJWlMIB4PkHDJLEpNLklNcU1JTy1mBEkXg+\
TcDAkrMcKjJASsJASXKWBJI4hKPErcIEp8BolzIdRAuxdqEUE/Uc0mfF5CdowhABdjfqo=\
 ";
l = VertexList[Graph[trans]];
(*Weigths for vertices*)
r = RandomReal[{0.5, 1}, Length[l]];
vs = Transpose@{l, r} /. List[a_, b_] -> Rule[a, b];
(*Adjust font size*)
vls = Transpose@{l, r} /. 
List[a_, b_] -> Rule[a, Directive[Black, Bold, 20*b]];
(*Weigths for line thicknes*)
rr = RandomReal[{0.1, 1}, Length[DeleteDuplicates@trans]]/100;
es = (First@# > Directive[Thickness[Last@#], Opacity[.5]]) & /@ 
Transpose@{DeleteDuplicates@trans, rr};
g = Graph[DeleteDuplicates@trans, 
VertexLabels -> Placed["Name", Center], 
VertexShapeFunction -> "Capsule", VertexSize -> vs, 
VertexLabelStyle -> vls, EdgeStyle -> es, 
EdgeShapeFunction -> 
GraphElementData["ShortUnfilledArrow", "ArrowSize" -> 0.03]]

and got this, which is not what I need
Graph

$\endgroup$
  • $\begingroup$ @Kuba I made the edit to include the data set. $\endgroup$ – Maria Iftikhar Mar 26 '14 at 8:01
  • $\begingroup$ try to put DeleteDuplicate when you generate the first graph: l = VertexList[Graph[DeleteDuplicates@trans]] $\endgroup$ – halmir Mar 26 '14 at 13:41
  • $\begingroup$ @halmir I actually need to find a way to assign the data to different planes of the graph with a keyword like M,L,R,N & AWA. See figure 1? Its not duplicate data, its data for different planes. $\endgroup$ – Maria Iftikhar Mar 27 '14 at 6:29
  • $\begingroup$ @Kuba have a look at the data now please? $\endgroup$ – Maria Iftikhar Apr 1 '14 at 6:32
  • $\begingroup$ @MariaIftikhar I can't help you, I'm not experienced enought in graphs. Take a look at GraphPlot3D it may be useful. $\endgroup$ – Kuba Apr 1 '14 at 6:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.