Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Graphplot - colors of particular edges

  • To: mathgroup at smc.vnet.net
  • Subject: [mg98819] Re: [mg98792] Graphplot - colors of particular edges
  • From: "David Park" <djmpark at comcast.net>
  • Date: Mon, 20 Apr 2009 01:31:11 -0400 (EDT)
  • References: <31325034.1240132863629.JavaMail.root@n11>

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 -> (If[
     First[#2] === "v2" \[And] Last[#2] === "v6" \[Or] 
      First[#2] === "v7" \[And] Last[#2] === "v0", {Red, 
      Thickness[0.0030], Line[#1]}, {Black, Thickness[0.0030], 
      Line[#1]}] &), 
 VertexRenderingFunction -> ({LightGray, Disk[#1, 0.25], Black, 
     Text[#2, #1]} &)]


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/  



From: MartyIX [mailto:vseticka.martin at gmail.com] 

Dear MathGroup, 

  is there an easy way how to change colors of some edges in 
graph? I think I can use this solution:

http://mathforum.org/kb/thread.jspa?forumID=79&threadID=1863422&messageID=65
16576#6516576

(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!




  • Prev by Date: Re: Strange Output!!!Please help me thank you.
  • Next by Date: Re: Looking for more Mathematica online user groups/forums
  • Previous by thread: Re: Graphplot - colors of particular edges
  • Next by thread: Looking for more Mathematica online user groups/forums