Yes. It's a tradeoff between sharper graphics and rounding issues with
pixels in plots. IIRC, the basic issue is that horizontal and vertical
lines are "snapped" to the nearest pixel, so that they aren't
anti-aliased and fuzzy.
This has been investigated quite a bit at:
In short, you can do:
matplotlib.rcParams['path.snap'] = False
This will make horizontal and vertical lines (like the axes) not snap to
the nearest pixel. Things may be a bit fuzzier, though.
All arrows are automatically shortened by a full line width on each side
so that you can draw arrows between lines and the arrow will just touch
the lines. Perhaps this decision should be revisited.
> I really prefer plotting to look as it should with fuzzier axes since
> otherwise sage can not be used to present graphs for other people.
Recently this capability became easy, so it should be put up for vote at
Well, then that is troubling, since the png and pdf outputs should be
the same. I see the same thing when I save to png or pdf. Can you give
an example command where you get different results?
Ah, yes. Remember how we discussed how horizontal and vertical lines
weren't quite true because they snapped to the pixels? Well, there
aren't pixels in vector graphics like pdf, so no rounding/snapping is
done, and everything is accurate.
> It is even more clear to the eye when adding extra thickness to the
> But then the function seems to be positive in t=-pi and negative in
> t=pi because of the way the beginning and end is drawn graphically. So
> by keeping thickness to max 1 and saving as pdf the plot is ok.
> Just a small question: Is there any reason why the end of the function
> is rounded while the beginning is not?
The function is square at both the beginning and end, at least in my
pdf. The function is drawn with capstyle="projecting", which means that
the endpoint of the curve is the center of the final square in the line.
Here is an explanation of the three types of ends ("caps") on a line:
(in that explanation, they call our "projecting" style the "square" style)