Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Consider the following.

Code

\documentclass{article}

\usepackage{pst-coil,pstricks-add}

\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

enter image description here

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)?

share|improve this question
    
Might you mean \pczigzag? (Instead of ps) –  A.Ellett Apr 2 '13 at 23:52
    
    
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) –  Herbert Apr 3 '13 at 7:15
    
I prefer the other method, but I can see your point. –  Svend Tveskæg Apr 3 '13 at 7:20
add comment

1 Answer

up vote 4 down vote accepted

enter image description here

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

\psset{algebraic}

\addtopsstyle{gridstyle}
{
    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} 
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.