How to change color and size at the same time of some vertices of a graph?
I am trying to do it more than an hour but nothing seems to work.
I can do it either for color or for size but not both at the same time.
I want to have big blue disks.
HighlightGraph[GridGraph[{3, 3}], {1, 2}, VertexSize -> .2]
HighlightGraph[GridGraph[{3, 3}], Style[{1, 2}, Blue]]
This does not work:
HighlightGraph[GridGraph[{3, 3}], {1, 2}, VertexSize -> .2,Style[{1, 2}, Blue]]
Update:
Why the following code changes size of all vertices, I want to change size only of the green ones.
HighlightGraph[
GridGraph[{3, 3}], {Style[PathGraph[{3, 2, 1, 4, 7, 8, 9, 6, 5}],
Red, Thickness[0.01]], Style[{3, 5}, Green]}, VertexSize -> 0.2]
HighlightGraph
will interpretVertexSize -> x
as wanting all highlighted vertices with sizex
. You want more control than that, so use the more explicit form of that option:VertexSize -> {3 -> 0.2, 5 -> 0.2}
$\endgroup$ – Jason B. Sep 4 '20 at 20:42