Re: Problem/bug with ends of thick lines in graphics
- To: mathgroup at smc.vnet.net
- Subject: [mg88534] Re: Problem/bug with ends of thick lines in graphics
- From: David Reiss <dbreiss at gmail.com>
- Date: Wed, 7 May 2008 07:11:11 -0400 (EDT)
- References: <fvhe27$3t8$1@smc.vnet.net> <fvpcsn$mjk$1@smc.vnet.net>
Alas, though this approach may work for this particular example the example was a distillation to show the bug though it arose in a more complicated case where choosing, for example, PlotPoints->3 would not be the right thing to do. Also removing points from the end of a line (or curve) changes the curve to something else, so this, as a general approach, would not serve well. The problem originally arouse in some work where there was a curve and it needed to be exported to PDF to then be included in a printed text book. The curve was not terribly thick, but it was noticeable in the PDF export that the ends of the curve were not up to the quality standards needed. The original fix was to include the explicit PostScript command in the PlotStyle option. But I know that this bug is being worked on by the folks at WRI for a future version of Mathematica... --David On May 6, 6:45 am, ragfield <ragfi... at gmail.com> wrote: > On May 3, 5:16 am, David Reiss <dbre... at gmail.com> wrote: > > > Consider the following graph: > > > Plot[x, {x, 1/3, 3/4}, PlotRange -> {{0, 1}, {0, 1}}, > > PlotStyle -> {AbsoluteThickness[20]}] > > > When you plot it you will see that the line's ends are not > > rectangular, whereas you would certainly want them to be so. > > =2E.. > > > Does anyone have any solutions to either or both of these issues? > > There are a couple of things you can do to alter the appearance of > this graphic. In this specific case adding PlotPoints->3 to the Plot > command is enough to do the trick. Another option is to manually > remove a few (4-5) points from both the start and end of the Line > primitive in the resulting graphic. This problem occurs when the > points at the beginning/end of the line are so very close together > that the OS graphics library gets a little confused about what angle > to draw the line cap, and it's really only noticeable when the line is > thick enough that the cap is clearly visible. > > -Rob