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
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.
Any ideas on how to fix this?
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.
>
> 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 ...
Szabolcs Horvát wrote:
>> 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 ...
>
Hi,
if you set Joined -> True, there are 2 points visible at:{1.5,0.5} and
{2.5,1.5} that should not be there.
Version:"6.0 for Microsoft Windows (32-bit) (February 7, 2008)"
Daniel
--
Daniel Huber
Metrohm Ltd.
Oberdorfstr. 68
CH-9100 Herisau
Tel. +41 71 353 8585, Fax +41 71 353 8907
E-Mail:<mailto:d...@metrohm.com>
Internet:<http://www.metrohm.com>
Oh, sorry, now I see what the OP meant. The Mesh option influences
this, but I couldn't find a workaround ...
It would probably be quicker not to use ListPlot at all, and just
build up the plot from graphics primitives (i.e. quicker than finding
a workaround for this bug) ... It would also make handling plot
markers easier ...
>igor...@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},
Here's a workaround:
Try moving the PlotRange option out of ListPlot (it has a different
meaning for plotting functions and for Graphics ... quite confusing ...):
Show[
ListPlot[{0, 1, 2},
PlotMarkers -> Style["\[FilledCircle]", FontSize -> 12],
Joined -> True, GridLines -> Automatic],
PlotRange -> {{1, 3}, {0.5, 1.5}}, AxesOrigin -> Automatic]
> >>>> the lower and upper edges of the plot.
> >>> I don't really understand this second question ...
>
> >> Hi,
> >> if you set Joined -> True, there are 2 points visible at:{1.5,0.5} and
> >> {2.5,1.5} that should not be there.
> >> Version:"6.0 for Microsoft Windows (32-bit) (February 7, 2008)"
> >> Daniel
>
> > Oh, sorry, now I see what the OP meant. The Mesh option influences
> > this, but I couldn't find a workaround ...
> > It would probably be quicker not to use ListPlot at all, and just
> > build up the plot from graphics primitives (i.e. quicker than finding
> > a workaround for this bug) ... It would also make handling plot
> > markers easier ...
>
> Here's a workaround:
>
> Try moving the PlotRange option out of ListPlot (it has a different
> meaning for plotting functions and for Graphics ... quite confusing ...):
>
> Show[
> ListPlot[{0, 1, 2},
> PlotMarkers -> Style["\[FilledCircle]", FontSize -> 12],
> Joined -> True, GridLines -> Automatic],
> PlotRange -> {{1, 3}, {0.5, 1.5}}, AxesOrigin -> Automatic]- Hide quot=
ed text -
>
> - Show quoted text -
O.K. Now I see that I need to use Show for PlotRange to work as
expected...
Though these are not the only problems with ListPlot.
Try to run the following code:
ListPlot[{{0, 0}, {1, 1}, {1, 2}, {1, 5}, {2, 2}, {2, 1}},
Joined -> True]
Automatic PlotRange definition seems to be very buggy. Most of the
graphic is not shown!
Actually, the problem with using Disk[] (or Point[]) is that they are
much slower than the default.
Try to run:
ListPlot[Range[1000], PlotMarkers -> {Graphics[Disk[]], 0.02}]
Compare it with:
ListPlot[Range[1000]]
And if you try to use Range[10000], you will see another difference.
Of course, that's a very large number of points, I don't need this in
practice, but I need to optimize the speed.
Actually, I need to plot several functions on the same plot, some of
which with points shown, some of them only as joined lines.
I think, that I need to use Show to implement this correctly.
Didn't yet try to measure speed of this function..
Perhaps you should read the documentation on PlotRange to appreciate
the choices made in the specifications of the options.
Note that for Automatic the outlying points are dropped! You probably
want PlotRange->Full which will give what I believe you expect and
want in your example below.
Try
Plot[Tan[x], {x, 0, 10}, PlotRange -> Automatic] versus Plot[Tan[x],
{x, 0, 10}, PlotRange -> Full] to get an appreciation of the difference.
HTH
Syd
Syd Geraghty B.Sc, M.Sc.
My System
Mathematica 6.0.2.1 for Mac OS X x86 (64 - bit) (March 13, 2008)
MacOS X V 10.5.2
MacBook Pro 2.33 Ghz Intel Core 2 Duo 2GB RAM
On May 24, 2008, at 12:56 AM, igor...@gmail.com wrote:
> On May 22, 2:17 pm, Szabolcs Horv=E1t <szhor...@gmail.com> wrote:
>> Szabolcs Horv=E1t wrote:
>>> On Tue, May 20, 2008 at 1:22 PM, dh <d...@metrohm.ch> wrote:
>>>> Szabolcs Horv=C3=A1t wrote:
>>
>>>>>> 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 ...
>>
>>>> Hi,
>>>> if you set Joined -> True, there are 2 points visible at:
>>>> {1.5,0.5} and
>>>> {2.5,1.5} that should not be there.
>>>> Version:"6.0 for Microsoft Windows (32-bit) (February 7, 2008)"
>>>> Daniel
>>
>>> Oh, sorry, now I see what the OP meant. The Mesh option influences
>>> this, but I couldn't find a workaround ...
>>> It would probably be quicker not to use ListPlot at all, and just
>>> build up the plot from graphics primitives (i.e. quicker than
>>> finding
>>> a workaround for this bug) ... It would also make handling plot
>>> markers easier ...
>>
>> Here's a workaround:
>>
>> Try moving the PlotRange option out of ListPlot (it has a different
>> meaning for plotting functions and for Graphics ... quite
>> confusing ...):
>>
>> Show[
>> ListPlot[{0, 1, 2},
>> PlotMarkers -> Style["\[FilledCircle]", FontSize -> 12],
On May 24, 11:58 am, igorv...@gmail.com wrote:
> On May 22, 2:17 pm, Szabolcs Horv=E1t <szhor...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Szabolcs Horv=E1t wrote:
> > > On Tue, May 20, 2008 at 1:22 PM, dh <d...@metrohm.ch> wrote:
> > >> Szabolcs Horv=C3=A1t wrote:
>
> > >>>> 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 cross=
es=
> > >>>> the lower and upper edges of the plot.
> > >>> I don't really understand this second question ...
>
> > >> Hi,
> > >> if you set Joined -> True, there are 2 points visible at:{1.5,0.5} an=
d
> > >> {2.5,1.5} that should not be there.
> > >> Version:"6.0 for Microsoft Windows (32-bit) (February 7, 2008)"
> > >> Daniel
>
> > > Oh, sorry, now I see what the OP meant. The Mesh option influences
> > > this, but I couldn't find a workaround ...
> > > It would probably be quicker not to use ListPlot at all, and just
> > > build up the plot from graphics primitives (i.e. quicker than finding
> > > a workaround for this bug) ... It would also make handling plot
> > > markers easier ...
>
> > Here's a workaround:
>
> > Try moving the PlotRange option out of ListPlot (it has a different
> > meaning for plotting functions and for Graphics ... quite confusing ...)=
:
>
> > Show[
> > ListPlot[{0, 1, 2},
> > PlotMarkers -> Style["\[FilledCircle]", FontSize -> 12],
> > Joined -> True, GridLines -> Automatic],
> > PlotRange -> {{1, 3}, {0.5, 1.5}}, AxesOrigin -> Automatic]- Hide qu=
ot=
> ed text -
>
> > - Show quoted text -
>
> O.K. Now I see that I need to use Show for PlotRange to work as
> expected...
>
> Though these are not the only problems with ListPlot.
> Try to run the following code:
>
> ListPlot[{{0, 0}, {1, 1}, {1, 2}, {1, 5}, {2, 2}, {2, 1}},
> Joined -> True]
>
> Automatic PlotRange definition seems to be very buggy. Most of the
> graphic is not shown!- Hide quoted text -