3
$\begingroup$

Bug introduced in 9.0 and fixed in 9.0.1


When I need to plot a 'large' graph with CommunityGraphPlot the output is always sized at the Mathematica default value. The Graph object itself can be resized with ImageSize option. However that doesn't work with Mathematica 9.0.0. The only option is to enlarge the plot by clicking the image and pull it to the wanted size. Then you can export this graph to PDF and print it. Is there a alternative way?

g = RandomGraph[{200, 300}, VertexLabels -> "Name",ImagePadding -> 20, ImageSize -> Scaled[0.5]]

enter image description here

CommunityGraphPlot[g]

enter image description here

UPDATE: I just found out that the CommunityGraphPlot generated can be double clicked and then you can freely drag the vertexes etc while keeping the connections! Can't do that with Graph object by default.

$\endgroup$
3
$\begingroup$

This is luckily fixed with Mathematica 9.0.1

g = RandomGraph[{200, 300}, VertexLabels -> "Name",ImagePadding -> 20, ImageSize -> Scaled[0.5]]

enter image description here

CommunityGraphPlot[g]

enter image description here

|improve this answer|||||
$\endgroup$
  • $\begingroup$ In 9.0.0, you could do Show[CommunityGraphPlot[g], ImageSize -> Scaled[0.5]] $\endgroup$ – halmir Mar 15 '13 at 15:44
  • $\begingroup$ @halmir Well why didn't I think of that... :) $\endgroup$ – Lou Mar 15 '13 at 15:48
  • $\begingroup$ @halmir post it as an answer too. I'll give you a point. $\endgroup$ – Lou Mar 15 '13 at 15:50
3
$\begingroup$

As Lou mentioned it's fixed in v 9.0.1. But in v 9.0.0, you could use Show to do that

g = RandomGraph[{200, 300}, VertexLabels -> "Name",ImagePadding -> 20, ImageSize -> Scaled[0.5]]

Show[CommunityGraphPlot[g], ImageSize -> Scaled[0.5]] 
|improve this answer|||||
$\endgroup$
  • $\begingroup$ I updated the question with a remark. Didn't know the communitygraph object can be dragged and dropped like a graph 'editor'. This is great! $\endgroup$ – Lou Mar 15 '13 at 16:01

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.