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 example:

Code

\documentclass{article}

\usepackage{pstricks-add}

\begin{document}

\begin{figure}
\centering
\psset{xunit=0.09cm,yunit=1.8cm}
\begin{pspicture}(-5,-0.25)(120,3)
\psaxes[Dx=10,Dy=0.5,comma]{->}(0,0)(-5,-0.25)(105,2.7)[$p$~(\%),0][$u$~(\%),90]
\psplot[algebraic,linewidth=1.25pt,linecolor=red]{0}{100}{2*sqrt(x*(100-x)/1633)}
\end{pspicture}
\end{figure}

\end{document}

Output

enter image description here

There are some wierd dents in the graph at the highlighted parts. Is this a problem with my PDF viewer or is it an error in pstricks-add?

I have tried both Evince and Adobe Reader as viewers but with the same result.

P.S. I am using Fedora 18 with the xfce desktop environment. (I am not sure if this is relevant.)

share|improve this question
    
Have you tried printing the page? Maybe it's just a rendering problem and will disappear on paper. –  Stephan Lukasczyk Mar 5 '13 at 8:40

1 Answer 1

up vote 12 down vote accepted

It is not a rendering problem. It is a problem caused by \psplot, which evaluates the given equation at regular intervals, and then connects with straight lines the resulting points.

You can control how many points are evaluated (and thus the distance among them) using the key plotpoints. If you reduce the number, the effect is dramatically visible:

\psplot[plotpoints=10, algebraic,linewidth=1.25pt,linecolor=red]{0}{100}{2*sqrt(x*(100-x)/1633)}

Bad

Note that the sampling distance in the x-axis is constant, but in the extremes of this curve the slope is much more pronounced, and then the slope discontinuity much more noticeable.

Using more points the effect is almost unnoticeable:

\psplot[plotpoints=500,algebraic,linewidth=1.25pt,linecolor=red]{0}{100}{2*sqrt(x*(100-x)/1633)}

Good

share|improve this answer
    
Excellent answer! –  Svend Tveskæg Mar 5 '13 at 9:00

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.