TransWikia.com

Graph styling using `HighlightGraph`, `GraphHighlightStyle` and `VertexStyle`at the same time

Mathematica Asked on March 11, 2021

I like the style when a graph is highlighted by HighlightGraph with parameter GraphHighlightStyle -> "Thick".

But I want to override the style of some vertices with different style.

I did this with the following code, but the style of vertices 13 and 17 does not mach the style of other vertices.

I want to change just the tint of the reddish color to something like greenish, but so that other properties of the vertices stay the same.

How to achieve this?

g = PolyhedronData["Dodecahedron", "Skeleton"];
HighlightGraph[g, {PathGraph[FindHamiltonianPath[g]]}, 
 GraphHighlightStyle -> {"Thick", 
   13 | 17 -> {VertexStyle -> {Green}}}]

enter image description here

UPDATE:

I had to do it manually – manually matching the tint of colors:

g = PolyhedronData["Dodecahedron", "Skeleton"];
HighlightGraph[g, {PathGraph[FindHamiltonianPath[g]]}, 
 GraphHighlightStyle -> {"Thick", 
   13 | 17 -> {VertexStyle -> {RGBColor[{128, 217, 128}/255], 
       EdgeForm[Directive[Thick, RGBColor[{0, 179, 0}/255]]]}}}]

enter image description here

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP