Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ListPlot skips first point

44 views
Skip to first unread message

Themis Matsoukas

unread,
May 22, 2013, 2:18:38 AM5/22/13
to
In the particular example below, the first point of data2 is *not* plotted. If I drop the last point of data2, then the first point comes into view. Not sure why.

data1 = {{1, 11.07}, {120, 11.07}};
data2 = {{1, 11.07}, {2, 2.15}, {3, 0.83}, {4, 0.43}, {5, 0.26}, {6,
0.17}, {7, 0.12}, {8, 0.09}, {9, 0.07}, {10, 0.06}, {11,
0.05}, {12, 0.04}, {13, 0.03}, {14, 0.03}, {15, 0.03}, {16,
0.02}, {17, 0.02}, {18, 0.02}, {19, 0.02}, {20, 0.01}, {21,
0.01}, {22, 0.01}, {23, 0.01}, {24, 0.01}, {25, 0.01}, {26,
0.01}, {27, 0.01}, {28, 0.01}, {29, 0.01}, {30, 0.01}, {31,
0.01}, {32, 0.01}, {33, 0.01}, {34, 0.01}, {35, 0.01}, {36,
0.01}, {37, 0.01}, {38, 0.01}, {39, 0.01}, {40, 0.01}, {41,
0.01}, {42, 0.01}, {43, 0.01}, {44, 0.01}, {45, 0.01}, {46, 0.01}};

Show[
ListLogPlot[data1, PlotStyle -> Red, Joined -> True,
PlotRange -> {{0, 20}, {0.001, 100}}],
ListLogPlot[data2, PlotStyle -> Blue, Joined -> True]
]

This is with v9 for the Mac.

Kevin J. McCann

unread,
May 23, 2013, 3:52:15 AM5/23/13
to
It plots fine for me. Windows 7, V9.0.1.

Kevin

Bob Hanlon

unread,
May 23, 2013, 3:53:16 AM5/23/13
to

I see this problem with v 9.0.0.0, but this does not occur with v 9.0.1.0
under Mac OS X 10.8.3


Bob Hanlon

djmpark

unread,
May 23, 2013, 3:52:56 AM5/23/13
to
When I evaluate your statements (using Show) in M 9.0.1 on Windows the first
point of data2 is plotted.

The following is a more detailed plot using Presentations with the points
shown and Tooltips on the data2 points, clearly showing that the first point
is used.

<< Presentations`

yticks = CustomTicks[Log, {-4, 3, {1.}, {2, 5}}];
Draw2D[
{ListLogDraw[data1, Joined -> True, PlotStyle -> Red],
ListLogDraw[data2, Joined -> True, PlotStyle -> Blue],
CirclePoint[{First[#], Log[Last[#]]}, 3, Black, White] & /@ data1,
Tooltip[
CirclePoint[{First[#], Log[Last[#]]}, 3, Black,
LightBlue], #] & /@ data2},
Frame -> True,
FrameTicks -> {{yticks, yticks // NoTickLabels}, {Automatic,
Automatic}},
PlotRange -> {{0, 20}, {Log[0.001], Log[100]}},
ImageSize -> 400]


David Park
djm...@comcast.net
http://home.comcast.net/~djmpark/index.html

Bill Rowe

unread,
May 23, 2013, 3:53:57 AM5/23/13
to
On 5/22/13 at 2:19 AM, tmats...@me.com (Themis Matsoukas) wrote:

>In the particular example below, the first point of data2 is *not*
>plotted. If I drop the last point of data2, then the first point
>comes into view. Not sure why.

>data1 = {{1, 11.07}, {120, 11.07}}; data2 = {{1, 11.07}, {2, 2.15},
>{3, 0.83}, {4, 0.43}, {5, 0.26}, {6, 0.17}, {7, 0.12}, {8,
>0.09}, {9, 0.07}, {10, 0.06}, {11, 0.05}, {12,
>0.04}, {13, 0.03}, {14, 0.03}, {15, 0.03}, {16, 0.02}, {17, 0.02},
>{18, 0.02}, {19, 0.02}, {20, 0.01}, {21, 0.01}, {22, 0.01}, {23,
>0.01}, {24, 0.01}, {25, 0.01}, {26, 0.01}, {27, 0.01}, {28, 0.01},
>{29, 0.01}, {30, 0.01}, {31, 0.01}, {32, 0.01}, {33, 0.01}, {34,
>0.01}, {35, 0.01}, {36, 0.01}, {37, 0.01}, {38, 0.01}, {39, 0.01},
>{40, 0.01}, {41, 0.01}, {42, 0.01}, {43, 0.01}, {44, 0.01}, {45,
>0.01}, {46, 0.01}};

>Show[
>ListLogPlot[data1, PlotStyle -> Red, Joined -> True, PlotRange ->
>{{0, 20}, {0.001, 100}}], ListLogPlot[data2, PlotStyle -> Blue,
>Joined -> True]
>]

>This is with v9 for the Mac.

Interesting. When I copy and paste from your post it appears to
me the first point is plotted whether or not the last point in
data2 is deleted. This with

In[12]:= $Version

Out[12]= 9.0 for Mac OS X x86 (64-bit) (January 24, 2013)


spamsl...@gmail.com

unread,
May 23, 2013, 3:55:18 AM5/23/13
to
Reverse your data1 and data2 variables.

Show[ListLogPlot[data2, PlotStyle -> Red, Joined -> True,
PlotRange -> {{0, 20}, {0.001, 100}}],
ListLogPlot[data1, PlotStyle -> Blue, Joined -> True]]

I don't know why that works, but it does. :o

Themis Matsoukas

unread,
May 24, 2013, 5:25:41 AM5/24/13
to
After updating to 9.0.1 the problem was resolved.

Thanks.

0 new messages