Using Graph
instead of GraphPlot
you get many convenient options for styling as shown in @ubpdqn's answer.
If you have to use GraphPlot
:
You can use the option PlotStyle->Black
to get black edges.
To style the vertices you can post-process the output to change Text
primitives into graphics primitives of your choice. For example:
el={1 -> 2, 2 -> 1, 3 -> 1, 3 -> 2, 4 -> 1, 4 -> 2, 4 -> 4};
g1 = GraphPlot[el, VertexLabeling -> True, PlotStyle -> Directive[Thick, Black]];
g2 = Block[{j = 1}, g1 /. Text[x_, y_] :> {ColorData[63, "ColorList"][[j++]],
Disk[y, .2], Black, Style[Text[x[[1]], y], 20, Bold]}];
Row[{g1, g2}]
If the input graph does not have vertex labels:
el2 = RandomSample[{5 -> 1, 1 -> 2, 2 -> 1, 4 -> 1, 4 -> 2, 3 -> 1, 3 -> 2, 4 -> 4}];
g2a = GraphPlot[el2, ImageSize -> 350, PlotStyle -> Directive[Thick, Black]];
g2b = Block[{j = 1}, g2a /. Point[x_] :>
With[{k = j++}, {ColorData[63, "ColorList"][[k]], Disk[x, .21],
Black, Style[ Text[k, x], 20, Bold]}]];
Row[{g2a, g2b}]
However, using edge and vertex rendering functions is not much more tedious than the post-processing approach.
For example, changing Arrow
to Line
in your code gives black lines; and the VertexRenderingFunction
you would need is very similar to the right-hand side of the replacement rule used above.
g3 = GraphPlot[el, EdgeRenderingFunction -> ({Thick,Black, Line[#1]} &)]
g4 = GraphPlot[el, EdgeRenderingFunction -> ({Thick, Black, Line[#1]} &),
VertexRenderingFunction -> ({ColorData[63, "ColorList"][[#2]],
Disk[#, .1], Black, Text[#2, #1]} &)]