({{, (RefLink[Dashing, paclet:ref/Dashing])[{(Subscript[r, 1]),(Subscript[r, 2]),…}]
is a two-dimensional graphics directive specifying that lines that follow are to be drawn dashed, with successive segments of lengths (Subscript[r, 1]), (Subscript[r, 2]), … (repeated cyclically). The (Subscript[r, i]) are given as a fraction of the total width of the graph. }, {, (RefLink[Dashing, paclet:ref/Dashing])[r]
is equivalent to (RefLink[Dashing, paclet:ref/Dashing])[{r,r}]. }})

OpenersNotesSection(Spacer1)Details

(RefLink[Dashing, paclet:ref/Dashing]) can be used in both two- and three-dimensional graphics, as well as in (RefLink[Style, paclet:ref/Style]) specifications.

(RefLink[Dashing, paclet:ref/Dashing])[{}] specifies that lines should be solid. »

The following symbolic forms for r can be used: (RefLink[Tiny, paclet:ref/Tiny]), (RefLink[Small, paclet:ref/Small]), (RefLink[Medium, paclet:ref/Medium]), and (RefLink[Large, paclet:ref/Large]). These specify absolute segment lengths independent of the total width of the graphic. »

If a segment has a length (Subscript[r, i]) specified as 0, it is drawn as a dot whose diameter is the thickness of the line. »

OpenersPrimaryExamplesSection(Spacer1)Examples  (17)

OpenersExampleSection0(Spacer1)Basic Examples  (4)

Specify the dashing of lines as successive segments with scaled lengths:

Table[Graphics[{Dashing[{r,0.1-r}],Line[{{0,0},{2,1}}]}],{r,{0.01,0.03,0.05,0.08}}]

Table[Graphics3D[{Dashing[{r,0.1-r}],Line[{{0,0,0},{2,1,1}}]}],{r,{0.01,0.03,0.05,0.08}}]

Set the dashing of edges of polygons:

p2=Polygon[{{-1,0},{0,Sqrt[3]},{1,0}}];

Table[Graphics[{Pink,EdgeForm[Dashing[r]],p2}],{r,{0.01,0.05,0.1}}]

p3=Polygon[{{1,0,0},{0,0,1},{1,1,1}}];

Table[Graphics3D[{Pink,EdgeForm[{Dashing[r]}],p3}],{r,{0.01,0.05,0.1}}]

Set the dashing of lines in plots using (RefLink[PlotStyle, paclet:ref/PlotStyle]):

Plot[{Sin[x], Cos[x]}, {x, 0, 2 π}, 
 PlotStyle -> {Dashing[Tiny], Dashing[Large]}]

Set the dashing of the frame:

Grid[Table[x,{4},{7}],Frame->All,FrameStyle->Dashing[Tiny]]

OpenersExampleSection1(Spacer1)Scope  (6)

OpenersExampleSubsection0(Spacer1)Dashing Specifications  (3)

No dashing:

Graphics[{Dashing[{}],Line[{{0,0},{2,1}}]}]

(RefLink[Dashing, paclet:ref/Dashing])[r] is equivalent to (RefLink[Dashing, paclet:ref/Dashing])[{r,r}]:

Table[Graphics[{Dashing[r],Line[{{0,0},{2,1}}]}],{r,{0.01,0.03,0.05,0.08}}]

Symbolic values for predefined absolute dashings:

Table[Graphics[{Dashing[r],Line[{{0,0},{2,1}}]}],{r,{Tiny,Small,Medium,Large}}]

Specify multiple cyclic segments:

Graphics[{Dashing[{0.1,0.02,0.05}],Line[{{0,0},{2,1}}]}]

OpenersExampleSubsection1(Spacer1)Primitives Affected  (3)

Specify the dashing of the shaft of an arrow:

Graphics[{Dashing[0.02],Arrow[{{0,0},{2,1}}]}]

Specify the dashing of edges of primitives using (RefLink[EdgeForm, paclet:ref/EdgeForm]):

Table[Graphics[{Pink,EdgeForm[Dashing[r]],Disk[]}],{r,{0.01,0.05,0.1}}]

Table[Graphics[{Pink,EdgeForm[Dashing[r]],Rectangle[]}],{r,{0.01,0.05,0.1}}]

Table[Graphics3D[{Pink,EdgeForm[Dashing[r]],Cylinder[]},Boxed->False],{r,{0.01,0.05,0.1}}]

Table[Graphics3D[{Pink,EdgeForm[Dashing[r]],Cuboid[]},Boxed->False],{r,{0.01,0.05,0.1}}]

OpenersExampleSection2(Spacer1)Properties & Relations  (5)

Use (RefLink[Dashed, paclet:ref/Dashed]), (RefLink[Dotted, paclet:ref/Dotted]), and (RefLink[DotDashed, paclet:ref/DotDashed]) to specify predefined absolute dashings:

{Graphics[{Dashed,Line[{{0,0},{2,1}}]}],Graphics[{Dotted,Line[{{0,0},{2,1}}]}],Graphics[{DotDashed,Line[{{0,0},{2,1}}]}]}

(RefLink[Dashing, paclet:ref/Dashing]) defines the length of a segment as a fraction of the total width of the graphic:

Graphics[{Thick,Dashing[{0.05,0.1}],Line[{{-1,0},{1,0}}]},Frame->True]

(RefLink[Dashing, paclet:ref/Dashing]) depends on the image size:

Table[Graphics[{Dashing[.05],Line[{{0,0},{2,1}}]},ImageSize->s],{s,{50,100,150}}]

(RefLink[AbsoluteDashing, paclet:ref/AbsoluteDashing]) defines the length of a segment in units of printer's points:

Graphics[{Thickness[.02],AbsoluteDashing[{15}],Line[{{0,0},{1,0}}],Text[Style["15 points",Black,FontSize->15],{0.5,0.1}]}]

(RefLink[AbsoluteDashing, paclet:ref/AbsoluteDashing]) is independent of the image size:

Table[Graphics[{AbsoluteDashing[10],Line[{{0,0},{2,1}}]},ImageSize->s],{s,{50,100,150}}]

The thickness of segments can be specified by (RefLink[Thickness, paclet:ref/Thickness]):

Table[Graphics[{Thickness[r],Dashing[Medium],Line[{{0,0},{2,1}}]}],{r,{0.01,0.03,0.05}}]

A segment with length 0 specifies a dot of the size defined by (RefLink[Thickness, paclet:ref/Thickness]):

Graphics[{Thickness[.05],Dashing[{0,0.1}],Line[{{0,0},{2,1}}]}]

OpenersExampleSection3(Spacer1)Neat Examples  (2)

Randomly dashed circles:

Graphics[Table[{Hue[RandomReal[]],Dashing[RandomReal[{0,0.07}]],Circle[RandomReal[1,{2}],RandomReal[]]},{20}]]

A curve with a random dash pattern:

ParametricPlot[t{Cos[t], Sin[t]},{t,0,50},PlotStyle->Directive[Thick,Dashing[RandomReal[{0,0.05},100]]]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[AbsoluteDashing, paclet:ref/AbsoluteDashing])  ▪  (RefLink[Dashed, paclet:ref/Dashed])  ▪  (RefLink[Dotted, paclet:ref/Dotted])  ▪  (RefLink[DotDashed, paclet:ref/DotDashed])  ▪  (RefLink[Thickness, paclet:ref/Thickness])  ▪  (RefLink[GrayLevel, paclet:ref/GrayLevel])  ▪  (RefLink[Hue, paclet:ref/Hue])  ▪  (RefLink[RGBColor, paclet:ref/RGBColor])  ▪  (RefLink[PlotStyle, paclet:ref/PlotStyle])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Three-Dimensional Graphics Directives, paclet:tutorial/ThreeDimensionalGraphicsDirectives])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Graphics Directives, paclet:guide/GraphicsDirectives])}, {▪(RefLinkPlain[Maps & Cartography, paclet:guide/MapsAndCartography])}, {▪(RefLinkPlain[Symbolic Graphics Language, paclet:guide/SymbolicGraphicsLanguage])}})}})