# Plot graph with axis discontinuities in PSTricks

Consider the following.

Code

\documentclass{article}

\begin{document}

\psset{xunit=0.8,yunit=0.6}
\begin{pspicture}(13,14)
\pszigzag[coilheight=0.3](0,0)(2,0)
\psaxes[Ox=16,Dx=1,yAxis=false]{->}(2,0)(13,0)[$d$,0][,90]
\pszigzag[coilheight=0.1](0,0)(0,2)
\psaxes[Oy=18,Dy=2,dy=1,xAxis=false]{->}(0,2)(0,19.5)[,0][$V$,90]
\psplot[algebraic,linewidth=1pt,linecolor=blue]{2}{12.5}{0.075*x^2}
\end{pspicture}

\end{document}

Output

Question

How do I

(A) get the \psziazag, at the beginning of the axes, to look better/proper, and

(B) plot the graph of the function 0.075*x^2 for $16 \leq x \leq 26$ correct (the y-values are not correct as it is now)?

• Might you mean \pczigzag? (Instead of ps) Commented Apr 2, 2013 at 23:52
• No; see mirrors.dotsrc.org/ctan/graphics/pstricks/contrib/pst-coil/…, secton 2.3. Commented Apr 2, 2013 at 23:58
• where is the sense to have both axes interruptedẞ To me it looks better to start the xes at (15;16) and not (0;0)
– user2478
Commented Apr 3, 2013 at 7:15
• I prefer the other method, but I can see your point. Commented Apr 3, 2013 at 7:20

\documentclass[pstricks,border={22pt 20pt 15pt 15pt}]{standalone}
\usepackage{pst-plot,pst-coil}
\def\f(#1){.075*(#1)^2}

\psset{algebraic}

{
gridlabels=0,
griddots=0,
subgriddiv=10,
subgridwidth=0.1pt,
gridwidth=0.3pt,
gridcolor=magenta,
subgridcolor=green!25,
}

\begin{document}
\begin{pspicture}[showgrid=bottom](12,10)
% y axis
\psaxes[xAxis=false](0,0.25)
\psyTick(0){0}
\pszigzag[coilarm=0.125,coilwidth=0.3,coilheight=0.5](0,0.25)(0,0.75)
\psaxes[xAxis=false,Oy=18,Dy=2,dy=0.5]{->}(0,1)(0,0.75)(0,10)[,0][$V$,90]
% x axis
\psaxes[yAxis=false](0.25,0)
\psxTick(0){0}
\pszigzag[coilarm=0.125,coilwidth=0.3,coilheight=0.5](0.25,0)(0.75,0)
\psaxes[yAxis=false,Ox=16]{->}(1,0)(0.75,0)(12,0)[$d$,0][,90]
% plotting
\psplot[yunit=0.5]{1}{11}{(\f(x+15)-14)/2}
\psdots[yunit=0.5](*11 {(\f(x+15)-14)/2})
\end{pspicture}

\end{document}