# How to set the Arrowheads style in a figure with broken vertical axes

I am trying to combine three separated curves into a same figure. The codes are inspired by another post and answers here.

Codes:

snip[pos_] :=
Graphics[{BezierCurve[{{0, -(1/2)}, {1/2, 0}, {-(1/2), 0}, {0,
1/2}}]}]}}];

data1 = {{1, 1.1}, {2, 1.5}, {3, 0.9}, {4, 2.3}, {5, 1.1}};
data2 = {{1, 1001.1}, {2, 1001.5}, {3, 1000.9}, {4, 1002.3}, {5,
1001.1}};
data3 = {{1, 8001.1}, {2, 8001.5}, {3, 8000.9}, {4, 8002.3}, {5,
8001.1}};

Map[Max, (BorderDimensions@
Image[Show[#, LabelStyle -> White, Background -> White]] & /@
p)~Flatten~{{3}, {2}}, {2}] + 1

p1 = ListPlot[data1, PlotRange -> All, Joined -> True, Mesh -> Full,
PlotStyle -> Red,
AxesStyle -> {{Arrowheads[.035], Directive[Black, 12]}, {snip[1],
Directive[Black, 12]}}, PlotRangePadding -> .2,
ImagePadding -> {{50, 5}, {15, 5}}, AspectRatio -> 1/3];

p2 = ListPlot[data2, PlotRange -> All, Joined -> True, Mesh -> Full,
PlotStyle -> Blue, Axes -> {False, True},
AxesStyle -> {{None}, {snip[0], Directive[Black, 12]}},
PlotRangePadding -> .2, ImagePadding -> {{50, 15}, {5, 5}},
AspectRatio -> 1/3];

p3 = ListPlot[data3, PlotRange -> All, Joined -> True, Mesh -> Full,
PlotStyle -> Magenta, Axes -> {False, True},
AxesStyle -> {{None}, {snip[0], Directive[Black, 12]}},
PlotRangePadding -> .2, ImagePadding -> {{50, 15}, {5, 5}},
AspectRatio -> 1/3];

output = Column[{p3, p2, p1} /.
Graphics[x__] :>
ImageSize -> 500]]
Export["testBrokenAxiesFigure.png", output]


and output are:

1. How can I add an additional arrow to the vertical axis of the figure?

2. And how can I change the single Bezier curve separation symbol (at 1002.5 on the vertical axis) into a double Bezier curve symbol like that at about 2.5 on the vertical axis?

We have to modify snipa little bit:

ClearAll[snip]

snipCurve = Graphics[
{BezierCurve[{{0, -(1/2)}, {1/2, 0}, {-(1/2), 0}, {0, 1/2}}]}
];

snip[pos_?NumberQ, primitive_Graphics: snipCurve] :=  snip[
{pos}, primitive
];

snip[pos_List, primitive_Graphics: snipCurve] := Arrowheads[
{Automatic, #, primitive} & /@ pos
];

snip[pos_List, primitives_List] :=  Arrowheads[
Flatten /@ MapThread[{Automatic, ##} &, {pos, primitives}]
];


Now it will accept a list of positions as well as list of primitives that should be used. For convenience a default Arrow can be put by {}.

SO, AxesStyle for p2, p3 (p1 without changes) respectively should be:

AxesStyle -> {
{None},
{snip[{0, 1}], Directive[Black, 12]}
}

AxesStyle -> {
{None},
{snip[{0, 1}, {snipCurve, {}}], Directive[Black, 12]}
}


Thank you very much! Is it possible to change the size of the vertical axis arrow?

Don't have time to prepare handy and general patterns for snip but we can change something in the last definition:

snip[sizes_List, pos_List, primitives_List] := Arrowheads[
Flatten /@ Transpose[{sizes, pos, primitives}]
]


Now, let's use this in yspec for p3:

AxesStyle -> {
{None},
{snip[{Automatic, .1}(*here*), {0, 1}, {snipCurve, {}}], Directive[Black, 12]}
}


and xspec for p1 can be changed directly:

AxesStyle -> {
{Arrowheads[.1(*here*), .035], Directive[Black, 12]},
{snip[1], Directive[Black, 12]}
}


• Thank you very much! Is it possible to change the size of the vertical axis arrow? ---I noticed there is a package SciDraw for scientific drawing, if such functions here can be generalized and combined into SciDraw, that would be great. Apr 18 '16 at 23:34
• BTW @Kuba, I also noticed in one of your answers, you posted "风向图" as a PlotTitle, are you a native speaker of such language? Apr 18 '16 at 23:39
• @user6043040 I will try to address your question about size in the incomming edit. No, I'm from the very center of Europe, that probably was the wind rose phrase I've googled to match OPs needs.
– Kuba
Apr 19 '16 at 6:04