开发者

Mathematica + GraphPlot + GraphicsGrid with EdgeLabels

I had some very strange problems with GraphicsGrid. The开发者_运维百科 individual PraphPlot:s looks nice and ok, but the code GraphicsGrid[{{GraphPlot[{{a -> b, "ab"}, {a -> c, "7"}}]}, {GraphPlot[{{a -> b, "5"}, {a -> c, "2"}}]}}] just produces 2 big clots of garbage. If I remove the edge labels, everything works as expected. I am using Mathematica 7.0.0.


I got the same as you did, though I'd have called them small bits of rubbish. I fiddled around for a few minutes and got this:

g1 = GraphPlot[{{a -> b, "ab"}, {a -> c, "7"}}];
g2 = GraphPlot[{{a -> b, "5"}, {a -> c, "2"}}];
Grid[{{g1}, {g2}}]

which is a bit different but maybe of some use. Got to get back to work now.


Personally, I hate using GraphicsGrid as I find its results unpredictable. As you commented on @High Performance Mark's answer that this is to be included in a paper (i.e. LaTeX), I'd suggest using the LevelScheme package by Mark Caprio. He's spent a lot of time figuring out how to lay out graphics in Mathematica, and it allows you to do sane things with tick marks that Mathematica does not do by default. It isn't the fastest package in the world, and takes a little to learn, but I highly recommend it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜