在 PSTricks 中绘制轴不连续的图形

在 PSTricks 中绘制轴不连续的图形

考虑以下。

代码

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

输出

在此处输入图片描述

问题

我如何

(A)使\psziazag轴开头的 看起来更好/更合适,并且

(B)绘制函数图0.075*x^2是否$16 \leq x \leq 26$正确(y 值现在不正确)?

答案1

在此处输入图片描述

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

相关内容