1
$\begingroup$

I have a graph gph as below:

gph = Graph[{1 -> 2, 2 -> 3, 3 -> 1}]

Currently, the background is white, and the vertexes are blue in color. How can I display a dark background and light vertexes?

The vertexes coordinates are important, while the edges are not important (they can even disappear).

Many thanks!

$\endgroup$
  • $\begingroup$ Graph[{1 -> 2, 2 -> 3, 3 -> 1}, GraphStyle->"BackgroundBlack"]? $\endgroup$ – kglr Jul 11 '18 at 17:14
  • $\begingroup$ gph = Graph[{1 -> 2, 2 -> 3, 3 -> 1}, Background -> Black, VertexStyle -> White] $\endgroup$ – Henrik Schumacher Jul 11 '18 at 17:14
3
$\begingroup$
Graph[{1 -> 2, 2 -> 3, 3 -> 1}, GraphStyle -> "BackgroundBlack"]

enter image description here

... if gph is already there

gph = Graph[{1 -> 2, 2 -> 3, 3 -> 1}];
SetProperty[gph, GraphStyle -> "BackgroundBlack"]

same picture

$\endgroup$
  • $\begingroup$ Thanks. How about if gph is already there (which is I can't change)? $\endgroup$ – H42 Jul 11 '18 at 17:17
  • $\begingroup$ @HMC, i updated the answer. $\endgroup$ – kglr Jul 11 '18 at 17:20

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.