7

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

4

1 Answer 1

4

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} 
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .