Re: Graphplot - colors of particular edges
- To: mathgroup at smc.vnet.net
- Subject: [mg98811] Re: Graphplot - colors of particular edges
- From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
- Date: Mon, 20 Apr 2009 01:29:43 -0400 (EDT)
- References: <gseos7$eft$1@smc.vnet.net>
Try this for the EdgeRenderingFunction option: EdgeRenderingFunction -> ({Switch[#2, {"v9", "v1"}, Red, {"v6", "v10"}, Green, {"v7", "v3"}, Blue, _, Black], Thickness[0.0030], Line[#1]} &) Cheers -- Sjoerd On Apr 19, 10:54 am, MartyIX <vseticka.mar... at gmail.com> wrote: > Dear MathGroup, > > is there an easy way how to change colors of some edges in graph? I t= hink I can use this solution: > > http://mathforum.org/kb/thread.jspa?forumID=79&threadID=1863422&messa= ... > > (only for edges) but it seems to be a little clumsy. > > This is my graph: > ==================== > GraphPlot[{"v9" -> "v1", "v9" -> "v5", "v9" -> "v7", "v9" -> "v4", > "v5" -> "v2", "v5" -> "v0", "v7" -> "v0", "v7" -> "v3", > "v2" -> "v1", "v3" -> "v4", "v2" -> "v6", "v0" -> "v6", > "v0" -> "v8", "v3" -> "v8", "v6" -> "v10", "v8" -> "v10", > "v1" -> "v10", "v4" -> "v10"}, VertexLabeling -> True, > VertexCoordinateRules -> {"v0" -> {0, 0}, "v2" -> {-2, 0}, > "v3" -> {2, 0}, "v1" -> {-3, 0}, "v4" -> {3, 0}, "v5" -> {-1, 1}, > "v7" -> {1, 1}, "v6" -> {-1, -1}, "v8" -> {1, -1}, "v9" -> {0, 2}, > "v10" -> {0, -2}}, > EdgeRenderingFunction -> ({Black, Thickness[0.0030], Line[#1]} &), > VertexRenderingFunction -> ({LightGray, Disk[#1, 0.25], Black, > Text[#2, #1]} &)] > =============== > > And I want to change color of several edges - not many. > > Thank you for any help!