New answers tagged

17

Edit: getting rid of FilledCurve to speed things up. Here's something fun: g = Normal @ Show @ CommunityGraphPlot[ ExampleData[{"NetworkGraph", "DolphinSocialNetwork"}] ]; dist = Normalize[#] (2./Pi ArcTan[Norm[5 #]]) &; DynamicModule[{drag,pts,prims} , pts = Union@Cases[g, {_?NumericQ, _?NumericQ}, \[Infinity]]; prims = ( First[g] ...


17

You can do this using Show and PlotRange which can be used in combination with graphs. To determine the full PlotRange of the original Graph you could use AbsoluteOptions to determine the values of the VertexCoordinates of the graph. The function CoordinateBoundingBox, introduced in V10.1, is helpful here: SeedRandom[1110]; g = RandomGraph[{70, 200}] ...


3

This is more or less directly cribbed from the help: Manipulate[Graphics[{color, Polygon[CirclePoints[sides]]}], {{sides, 3,"Number of Sides"}, 3, 17, 1}, {color, Green}]


3

I believe this is the natural and idiomatic way to do it: Manipulate[Graphics[{colour, Polygon[CirclePoints[sides]]}], {sides, 3, 17, 1}, {{colour, Orange}, {Green -> "Green", Orange -> "Orange"}} ]


3

TabView is for viewing. You can associate color changes with the second argument of TabView but it will be easier to just use what is designed for that, like SetterBar. Moreover, the less inside Dynamic the better so instead of creating whole Graphics you can just tell the FrontEnd to take care of that colour and Polygon. DynamicModule[{p = 3, colour = ...


7

If you leave ContourPlot outside you can get quite nice performance: static = ContourPlot[45 x^2 + 20 y^2 == 45, {x, -2, 2}, {y, -2, 2}, Frame -> False]; dynamic = ContourPlot[8 x^2 + 4 x y + 5 y^2 == 9, {x, -2, 2}, {y, -2, 2}, Frame -> False, ContourStyle -> Orange]; Manipulate[ Graphics[{ First@static, ...



Top 50 recent answers are included