Re: Problems with ListPlot
- To: mathgroup at smc.vnet.net
- Subject: [mg88925] Re: Problems with ListPlot
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Wed, 21 May 2008 14:51:54 -0400 (EDT)
On 5/20/08 at 6:53 AM, szhorvat at gmail.com (Szabolcs Horv=C3=A1t) wrote:
>igorvict at gmail.com wrote:
>>I noticed the following problems when creating ListPlot in
>>Mathematica 6 (see the example):
>>ListPlot[{0, 1, 2}, PlotMarkers -> Style["\[FilledCircle]",
>>FontSize -> 12], Joined -> True, GridLines -> Automatic, PlotRange
>>-> {{1, 3}, {0.5, 1.5}}, PlotRangeClipping -> False, ImagePadding
>>-> 10]
>>1) The plot markers have an offset slightly to the left from their
>>correct position
>Precise positioning is not really achievable when glyphs from a font
>are used as plot markers. The problem can be cured by using
>graphics objects:
>PlotMarkers -> {Graphics[Circle[]], .05}
>Or if you need disks as plot markers, then just use a larger point
>size.
Why not use
PlotMarkers -> {Graphics[Disk[]], .05}
if you want disks as plot markers instead of circles?
>>2) In addition of 1 point and 1 line (2 other should be clipped as
>>they lie outside of the range) I see 2 points, where the line
>>crosses the lower and upper edges of the plot.
>I don't really understand this second question ...
I think the original poster was thinking the graphic should be
consistent with:
ListPlot[{0, 1, 2}, PlotMarkers -> {Graphics[Disk[]], .05},
Joined -> True, GridLines -> Automatic,
PlotRange -> {{1, 3}, {0.5, 1.5}}]
Notice the top and bottom disks are clipped since the specified
value of PlotRange isn't sufficient to fully include the top and
bottom disks.
I believe the reason this was not seen using the original
poster's code was due to the inclusion of the ImagePadding
option and using PlotRangeClipping->False which combine so that
the top and bottom disks are not clipped. That is compare the
graphic using the code above to:
ListPlot[{0, 1, 2}, PlotMarkers -> {Graphics[Disk[]], .05},
Joined -> True, GridLines -> Automatic,
PlotRange -> {{1, 3}, {0.5, 1.5}}, PlotRangeClipping -> False,
ImagePadding -> 10]