# How to impose custom style to the edges of a graph

We construct a graph as the following.

node = {11, 12, 13, 14, 15, 16};
edges = {11 -> 14, 11 -> 16, 12 -> 16, 12 -> 15, 13 -> 15, 13 -> 16,
14 -> 16, 14 -> 15, 15 -> 16, 15 -> 13, 16 -> 15, 16 -> 14};
vertexposition = {{6.51493919050084, 44.04756585632944},
{75.59445680043342, 50.47455242214042},
{87.32825501506514, 13.395648943951699},
{28.795707353492418, 3.420138063734413},
{60.729164933330765, 16.915777496473908},
{51.85158892659126, 25.803692768150313}};
Show[
Graph[node, edges, VertexCoordinates -> vertexposition,
VertexSize -> {"Scaled", .02},VertexLabels -> "Name"],
Frame -> True, FrameTicks -> True, ImageSize -> 600]


1. Now in the above graph how can I can control the size of the Arrowheads and thickness/color/opacity of the lines?
2. Is there any options that I can use to make the graph aesthetically more eye catching (sorry for using a qualitative term!)?
3. Without using Show can I display the frame and the axes values directly in a Graph?
• Have you checked the docs? There are really so many examples there of exactly what you are asking for. Please do try to find the solution before you post such a question, and do describe what you tried so far and why it wasn't good enough. Feb 29, 2012 at 13:02

For the first part of your question you can use a custom function for the EdgeShapeFunction option of Graph:

Let

   edgeshape[e_, ___] := {Arrowheads[Large], Red, Thick, Arrow[e, 0.2]}


and use as

 Show[Graph[node, edges, VertexCoordinates -> vertexposition,
VertexSize -> {"Scaled", .02}, VertexLabels -> "Name",
EdgeShapeFunction -> edgeshape], Frame -> True, FrameTicks -> True,
ImageSize -> 600]


to get

Graph also takes Graphics options, so you can use

 Graph[node, edges, VertexCoordinates -> vertexposition,
VertexSize -> {"Scaled", .02}, VertexLabels -> "Name",
EdgeShapeFunction -> edgeshape, Axes -> True, Ticks -> Automatic,
TicksStyle -> Directive[Orange, 12], PlotRangePadding -> .1,
AxesOrigin -> {0, 0}]


to get

Update: Using Szabolcs's revised answer, adding Frame->True, FrameTicks->All to options

 Graph[node, edges, VertexCoordinates -> vertexposition,
VertexSize -> {"Scaled", .02}, VertexLabels -> "Name",
EdgeShapeFunction -> edgeshape, Frame -> True, Axes -> False,
FrameTicks -> All, FrameTicksStyle -> Directive[Orange, 12]]!


You can also define your custom tick function. e.g.

 ticks[min_, max_] :=
Table[If[EvenQ[i], {i, i, {.01, 0}, Red}, {i, i, {.01, 0},  Blue}], {i, Floor[min],   Floor[max], 10}]


and use it with FrameTicks

 Graph[node, edges, VertexCoordinates -> vertexposition,
VertexSize -> {"Scaled", .02}, VertexLabels -> "Name",
EdgeShapeFunction -> edgeshape, Frame -> True, Axes -> False,
FrameTicks -> ticks, FrameTicksStyle -> Directive[Orange, 12],

1. Use EdgeStyle with Arrowheads, Thickness, colour specifications, Opacity.
2. Graph will take the same options as Graphics so you can use Frame -> True, FrameTicks -> All