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

Replace a vertical line in ListPlot

75 views
Skip to first unread message

Alexei Boulbitch

unread,
Apr 11, 2012, 6:24:14 PM4/11/12
to
Dear community,

I am making a ListPlot with the Frame->True option. Here is a simplified example showing the feature in question:

ListPlot[Table[{k, 7./k}, {k, 10, 70, 1}], Frame -> True]

It is everything fine with this plot as soon as the table starts with k=10. However, if the table starts with k=12 instead of 10, like here:

ListPlot[Table[{k, 7./k}, {k, 12, 70, 1}], Frame -> True]

the plot shows a vertical solid line at k.

Why does it appear?
and
How can I remove this line?

Thank you, Alexei

Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone : +352-2454-2566
Office fax: +352-2454-3566
mobile phone: +49 151 52 40 66 44

e-mail: alexei.b...@iee.lu




Ray Koopman

unread,
Apr 12, 2012, 4:42:20 AM4/12/12
to
> e-mail: alexei.boulbi...@iee.lu

ListPlot[Table[{k, 7./k}, {k, 12, 70, 1}], Frame->True, Axes->False]

Dr. Wolfgang Hintze

unread,
Apr 13, 2012, 4:47:38 AM4/13/12
to
> e-mail: alexei.boulbi...@iee.lu
>
>

Strange behaviour, indeed. You can even try to find the start of this
behaviour using decimal values for the PlotRange.

It seems that some internal automatic setting of the origin of the y-
axis is at work placing the axis at x.
You can see this setting Frame->False.

I suggest to use the option AxesOrigin->{0,0} to define things
clearly.
Then the line disappears.

Best regards,
Wolfgang

Bob Hanlon

unread,
Apr 13, 2012, 4:49:41 AM4/13/12
to
The line is the y-axis. It defaults in this case to a value within the frame.

Options[ListPlot, Axes]

{Axes -> True}

Often, when using a frame you want to suppress one or both axes.

ListPlot[
Table[{k, 7./k}, {k, 12, 70, 1}],
Frame -> True,
Axes -> {True, False}]

ListPlot[
Table[{k, 7./k}, {k, 12, 70, 1}],
Frame -> True,
Axes -> False]


Bob Hanlon

On Wed, Apr 11, 2012 at 6:20 PM, Alexei Boulbitch
<Alexei.B...@iee.lu> wrote:
> Dear community,
>
> I am making a ListPlot with the Frame->True option. Here is a simplified example showing the feature in question:
>
> ListPlot[Table[{k, 7./k}, {k, 10, 70, 1}], Frame -> True]
>
> It is everything fine with this plot as soon as the table starts with k=10. However, if the table starts with k=12 instead of 10, like here:
>
> ListPlot[Table[{k, 7./k}, {k, 12, 70, 1}], Frame -> True]
>
> the plot shows a vertical solid line at k.
>
> Why does it appear?
> and
> How can I remove this line?
>
> Thank you, Alexei
>
> Alexei BOULBITCH, Dr., habil.
> IEE S.A.
> ZAE Weiergewan,
> 11, rue Edmond Reuter,
> L-5326 Contern, LUXEMBOURG
>
> Office phone : +352-2454-2566
> Office fax: +352-2454-3566
> mobile phone: +49 151 52 40 66 44
>
> e-mail: alexei.b...@iee.lu

Adriano Pascoletti

unread,
Apr 13, 2012, 4:55:18 AM4/13/12
to

Mathematica places the origin at {20,0} so

ListPlot[Table[{k, 7./k}, {k, 12, 70, 1}], Frame -> True, Axes -> False]


solves the problem.


Adriano Pascoletti

2012/4/12 Alexei Boulbitch <Alexei.B...@iee.lu>

Bill Rowe

unread,
Apr 13, 2012, 4:44:04 AM4/13/12
to
On 4/11/12 at 6:20 PM, Alexei.B...@iee.lu (Alexei Boulbitch)
wrote:

>ListPlot[Table[{k, 7./k}, {k, 12, 70, 1}], Frame -> True]

>the plot shows a vertical solid line at k.

>Why does it appear? and How can I remove this line?

The vertical line that appears is the vertical axis. I don't
really know what algorithm Mathematica uses that causes an axis
to be displayed in ListPlot and determines where it will be
displayed. To remove it, simply add Axes->None as one of the
options for ListPlot.


Tomas Garza

unread,
Apr 13, 2012, 4:43:33 AM4/13/12
to
First question: I don't know, but it looks as if it's trying to draw
a vertical axis at k.Second question: If you explicitly remove the axis,
it works.
ListPlot[Table[{k,7./k},{k,12,70,1}],Axes->None,Frame->True]
-Tomas

> Date: Wed, 11 Apr 2012 18:20:50 -0400
> From: Alexei.B...@iee.lu
> Subject: Replace a vertical line in ListPlot
> To: math...@smc.vnet.net
>
> Dear community,
>
> I am making a ListPlot with the Frame->True option. Here is a simplified
example showing the feature in question:
>
> ListPlot[Table[{k, 7./k}, {k, 10, 70, 1}], Frame -> True]
>
> It is everything fine with this plot as soon as the table starts with k=10. However, if the table starts with k=12 instead of 10, like here:
>
> ListPlot[Table[{k, 7./k}, {k, 12, 70, 1}], Frame -> True]
>
> the plot shows a vertical solid line at k.
>
> Why does it appear?
> and
> How can I remove this line?
>

rafapa

unread,
Apr 13, 2012, 5:07:00 AM4/13/12
to
> e-mail: alexei.boulbi...@iee.lu

Dear Alexi,
it's not a line it's an axis. Just try:
ListPlot[Table[{k, 7./k}, {k, 12, 70, 1}], Axes -> False,
Frame -> True]

Regards,

Rafael

djmpark

unread,
Apr 13, 2012, 5:08:01 AM4/13/12
to
Alexei,

It's a matter of Mathematica adaptively choosing where to put the Axes,
which you probably thought were banished because you had used Frame -> True.
But Mathematica allows a Frame AND Axes.

So just add the Option Axes -> None.

ListPlot[Table[{k, 7./k}, {k, 12, 70, 1}], Frame -> True,
Axes -> None]


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


From: Alexei Boulbitch [mailto:Alexei.B...@iee.lu]


Dear community,

I am making a ListPlot with the Frame->True option. Here is a simplified
example showing the feature in question:

ListPlot[Table[{k, 7./k}, {k, 10, 70, 1}], Frame -> True]

It is everything fine with this plot as soon as the table starts with k=10.
However, if the table starts with k=12 instead of 10, like here:

ListPlot[Table[{k, 7./k}, {k, 12, 70, 1}], Frame -> True]

the plot shows a vertical solid line at k.

Why does it appear?
and
How can I remove this line?

Thank you, Alexei

Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone : +352-2454-2566
Office fax: +352-2454-3566
mobile phone: +49 151 52 40 66 44

e-mail: alexei.b...@iee.lu





Alexei Boulbitch

unread,
Apr 16, 2012, 6:12:54 AM4/16/12
to
I received a number of answers to my question, all of them very helpful. I am very much grateful to all of you for them.
Alexei



Alexei,

It's a matter of Mathematica adaptively choosing where to put the Axes,
which you probably thought were banished because you had used Frame -> True.
But Mathematica allows a Frame AND Axes.

So just add the Option Axes -> None.

ListPlot[Table[{k, 7./k}, {k, 12, 70, 1}], Frame -> True,
Axes -> None]


#David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/index.html


From: Alexei Boulbitch [mailto:Alexei.Boulbitch at iee.lu]


Dear community,

I am making a ListPlot with the Frame->True option. Here is a simplified
example showing the feature in question:

ListPlot[Table[{k, 7./k}, {k, 10, 70, 1}], Frame -> True]

It is everything fine with this plot as soon as the table starts with k=10.
However, if the table starts with k=12 instead of 10, like here:

ListPlot[Table[{k, 7./k}, {k, 12, 70, 1}], Frame -> True]

the plot shows a vertical solid line at k.

Why does it appear?
and
How can I remove this line?

Thank you, Alexei

Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone : +352-2454-2566
Office fax: +352-2454-3566
mobile phone: +49 151 52 40 66 44

e-mail: alexei.boulbitch at iee.lu
0 new messages