`mgp[1:3]' are of differing sign (PR#14130)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

`mgp[1:3]' are of differing sign (PR#14130)

cornell.p.gonschior
Full_Name: Cornell Gonschior
Version: 2.10.0
OS: Linux
Submission from: (NULL) (212.201.28.40)


Hi,

in the introduction to R, you can find the following sentence in the par()
chapter:
"Use tck=0.01 and mgp=c(1,-1.5,0) for internal tick marks."
I thought that's nice, because I wanted to have tick marks and tick labels
inside and the axis title outside.

But:
> plot(z, las=1, tck=0.01, mgp=c(1,-1.5,0))
Warnmeldungen:
1: In plot.window(...) : `mgp[1:3]' are of differing sign
2: In plot.xy(xy, type, ...) : `mgp[1:3]' are of differing sign
3: In axis(side = side, at = at, labels = labels, ...) :
  `mgp[1:3]' are of differing sign
4: In axis(side = side, at = at, labels = labels, ...) :
  `mgp[1:3]' are of differing sign
5: In box(...) : `mgp[1:3]' are of differing sign
6: In title(...) : `mgp[1:3]' are of differing sign

> par(las=1, tck=0.01, mgp=c(1,-1,0))
Warnmeldung:
In par(las = 1, tck = 0.01, mgp = c(1, -1, 0)) :
  `mgp[1:3]' are of differing sign

Was there a recent change, couldn't find anything useful searching the web.

Regards,
Cornell

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: `mgp[1:3]' are of differing sign (PR#14130)

Peter Ehlers

[hidden email] wrote:

> Full_Name: Cornell Gonschior
> Version: 2.10.0
> OS: Linux
> Submission from: (NULL) (212.201.28.40)
>
>
> Hi,
>
> in the introduction to R, you can find the following sentence in the par()
> chapter:
> "Use tck=0.01 and mgp=c(1,-1.5,0) for internal tick marks."
> I thought that's nice, because I wanted to have tick marks and tick labels
> inside and the axis title outside.
>
> But:
>> plot(z, las=1, tck=0.01, mgp=c(1,-1.5,0))
> Warnmeldungen:
> 1: In plot.window(...) : `mgp[1:3]' are of differing sign
> 2: In plot.xy(xy, type, ...) : `mgp[1:3]' are of differing sign
> 3: In axis(side = side, at = at, labels = labels, ...) :
>   `mgp[1:3]' are of differing sign
> 4: In axis(side = side, at = at, labels = labels, ...) :
>   `mgp[1:3]' are of differing sign
> 5: In box(...) : `mgp[1:3]' are of differing sign
> 6: In title(...) : `mgp[1:3]' are of differing sign
>
>> par(las=1, tck=0.01, mgp=c(1,-1,0))
> Warnmeldung:
> In par(las = 1, tck = 0.01, mgp = c(1, -1, 0)) :
>   `mgp[1:3]' are of differing sign
>
> Was there a recent change, couldn't find anything useful searching the web.
>
> Regards,
> Cornell

Well, it's only a warning, making you aware of a possibly
unintended par setting. Warnings are good things but if you
don't want to see them, they can be suppressed.

Certainly not a bug.

  -Peter Ehlers
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>

--
Peter Ehlers
University of Calgary
403.202.3921

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: `mgp[1:3]' are of differing sign (PR#14130)

Peter Dalgaard
Peter Ehlers wrote:

>
> [hidden email] wrote:
>> Full_Name: Cornell Gonschior
>> Version: 2.10.0
>> OS: Linux
>> Submission from: (NULL) (212.201.28.40)
>>
>>
>> Hi,
>>
>> in the introduction to R, you can find the following sentence in the
>> par()
>> chapter:
>> "Use tck=0.01 and mgp=c(1,-1.5,0) for internal tick marks."
>> I thought that's nice, because I wanted to have tick marks and tick
>> labels
>> inside and the axis title outside.
>>
>> But:
>>> plot(z, las=1, tck=0.01, mgp=c(1,-1.5,0))
>> Warnmeldungen:
>> 1: In plot.window(...) : `mgp[1:3]' are of differing sign
>> 2: In plot.xy(xy, type, ...) : `mgp[1:3]' are of differing sign
>> 3: In axis(side = side, at = at, labels = labels, ...) :
>>   `mgp[1:3]' are of differing sign
>> 4: In axis(side = side, at = at, labels = labels, ...) :
>>   `mgp[1:3]' are of differing sign
>> 5: In box(...) : `mgp[1:3]' are of differing sign
>> 6: In title(...) : `mgp[1:3]' are of differing sign
>>
>>> par(las=1, tck=0.01, mgp=c(1,-1,0))
>> Warnmeldung:
>> In par(las = 1, tck = 0.01, mgp = c(1, -1, 0)) :
>>   `mgp[1:3]' are of differing sign
>>
>> Was there a recent change, couldn't find anything useful searching the
>> web.
>>
>> Regards,
>> Cornell
>
> Well, it's only a warning, making you aware of a possibly
> unintended par setting. Warnings are good things but if you
> don't want to see them, they can be suppressed.
>
> Certainly not a bug.

Hmm, then again, I tend to agree with Cornell that there are a bit too
many cases where mgp[1:3]' would sensibly have differing sign, compared
to cases where it is a mistake. In addition to internal tick marks and
labels, there are also cases where the whole axis is shifted into the
plot area. I'd more likely use axis(pos=...) for that, but still.

--
    O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
   c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
  (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - ([hidden email])              FAX: (+45) 35327907

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: `mgp[1:3]' are of differing sign (PR#14130)

Peter Dalgaard
In reply to this post by cornell.p.gonschior
Peter Ehlers wrote:

>
> [hidden email] wrote:
>> Full_Name: Cornell Gonschior
>> Version: 2.10.0
>> OS: Linux
>> Submission from: (NULL) (212.201.28.40)
>>
>>
>> Hi,
>>
>> in the introduction to R, you can find the following sentence in the
>> par()
>> chapter:
>> "Use tck=0.01 and mgp=c(1,-1.5,0) for internal tick marks."
>> I thought that's nice, because I wanted to have tick marks and tick
>> labels
>> inside and the axis title outside.
>>
>> But:
>>> plot(z, las=1, tck=0.01, mgp=c(1,-1.5,0))
>> Warnmeldungen:
>> 1: In plot.window(...) : `mgp[1:3]' are of differing sign
>> 2: In plot.xy(xy, type, ...) : `mgp[1:3]' are of differing sign
>> 3: In axis(side = side, at = at, labels = labels, ...) :
>>   `mgp[1:3]' are of differing sign
>> 4: In axis(side = side, at = at, labels = labels, ...) :
>>   `mgp[1:3]' are of differing sign
>> 5: In box(...) : `mgp[1:3]' are of differing sign
>> 6: In title(...) : `mgp[1:3]' are of differing sign
>>
>>> par(las=1, tck=0.01, mgp=c(1,-1,0))
>> Warnmeldung:
>> In par(las = 1, tck = 0.01, mgp = c(1, -1, 0)) :
>>   `mgp[1:3]' are of differing sign
>>
>> Was there a recent change, couldn't find anything useful searching the
>> web.
>>
>> Regards,
>> Cornell
>
> Well, it's only a warning, making you aware of a possibly
> unintended par setting. Warnings are good things but if you
> don't want to see them, they can be suppressed.
>
> Certainly not a bug.

Hmm, then again, I tend to agree with Cornell that there are a bit too
many cases where mgp[1:3]' would sensibly have differing sign, compared
to cases where it is a mistake. In addition to internal tick marks and
labels, there are also cases where the whole axis is shifted into the
plot area. I'd more likely use axis(pos=...) for that, but still.

--
    O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
   c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
  (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - ([hidden email])              FAX: (+45) 35327907

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: `mgp[1:3]' are of differing sign (PR#14130)

Peter Ehlers
In reply to this post by Peter Dalgaard
Peter Dalgaard wrote:

> Peter Ehlers wrote:
>>
>> [hidden email] wrote:
>>> Full_Name: Cornell Gonschior
>>> Version: 2.10.0
>>> OS: Linux
>>> Submission from: (NULL) (212.201.28.40)
>>>
>>>
>>> Hi,
>>>
>>> in the introduction to R, you can find the following sentence in the
>>> par()
>>> chapter:
>>> "Use tck=0.01 and mgp=c(1,-1.5,0) for internal tick marks."
>>> I thought that's nice, because I wanted to have tick marks and tick
>>> labels
>>> inside and the axis title outside.
>>>
>>> But:
>>>> plot(z, las=1, tck=0.01, mgp=c(1,-1.5,0))
>>> Warnmeldungen:
>>> 1: In plot.window(...) : `mgp[1:3]' are of differing sign
>>> 2: In plot.xy(xy, type, ...) : `mgp[1:3]' are of differing sign
>>> 3: In axis(side = side, at = at, labels = labels, ...) :
>>>   `mgp[1:3]' are of differing sign
>>> 4: In axis(side = side, at = at, labels = labels, ...) :
>>>   `mgp[1:3]' are of differing sign
>>> 5: In box(...) : `mgp[1:3]' are of differing sign
>>> 6: In title(...) : `mgp[1:3]' are of differing sign
>>>
>>>> par(las=1, tck=0.01, mgp=c(1,-1,0))
>>> Warnmeldung:
>>> In par(las = 1, tck = 0.01, mgp = c(1, -1, 0)) :
>>>   `mgp[1:3]' are of differing sign
>>>
>>> Was there a recent change, couldn't find anything useful searching
>>> the web.
>>>
>>> Regards,
>>> Cornell
>>
>> Well, it's only a warning, making you aware of a possibly
>> unintended par setting. Warnings are good things but if you
>> don't want to see them, they can be suppressed.
>>
>> Certainly not a bug.
>
> Hmm, then again, I tend to agree with Cornell that there are a bit too
> many cases where mgp[1:3]' would sensibly have differing sign, compared
> to cases where it is a mistake. In addition to internal tick marks and
> labels, there are also cases where the whole axis is shifted into the
> plot area. I'd more likely use axis(pos=...) for that, but still.
>
And, I suppose, if R-Intro mentions it, it would be less confusing
if there were mention of the warning. But use of R conditions one to
seeing warnings as a good thing. Can't count the number of times
I've seen "longer ... is not a multiple of shorter ..." and having
it catch a silly user error.

--
Peter Ehlers
University of Calgary
403.202.3921

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: `mgp[1:3]' are of differing sign (PR#14130)

Peter Ehlers
In reply to this post by cornell.p.gonschior
Peter Dalgaard wrote:

> Peter Ehlers wrote:
>>
>> [hidden email] wrote:
>>> Full_Name: Cornell Gonschior
>>> Version: 2.10.0
>>> OS: Linux
>>> Submission from: (NULL) (212.201.28.40)
>>>
>>>
>>> Hi,
>>>
>>> in the introduction to R, you can find the following sentence in the
>>> par()
>>> chapter:
>>> "Use tck=0.01 and mgp=c(1,-1.5,0) for internal tick marks."
>>> I thought that's nice, because I wanted to have tick marks and tick
>>> labels
>>> inside and the axis title outside.
>>>
>>> But:
>>>> plot(z, las=1, tck=0.01, mgp=c(1,-1.5,0))
>>> Warnmeldungen:
>>> 1: In plot.window(...) : `mgp[1:3]' are of differing sign
>>> 2: In plot.xy(xy, type, ...) : `mgp[1:3]' are of differing sign
>>> 3: In axis(side = side, at = at, labels = labels, ...) :
>>>   `mgp[1:3]' are of differing sign
>>> 4: In axis(side = side, at = at, labels = labels, ...) :
>>>   `mgp[1:3]' are of differing sign
>>> 5: In box(...) : `mgp[1:3]' are of differing sign
>>> 6: In title(...) : `mgp[1:3]' are of differing sign
>>>
>>>> par(las=1, tck=0.01, mgp=c(1,-1,0))
>>> Warnmeldung:
>>> In par(las = 1, tck = 0.01, mgp = c(1, -1, 0)) :
>>>   `mgp[1:3]' are of differing sign
>>>
>>> Was there a recent change, couldn't find anything useful searching
>>> the web.
>>>
>>> Regards,
>>> Cornell
>>
>> Well, it's only a warning, making you aware of a possibly
>> unintended par setting. Warnings are good things but if you
>> don't want to see them, they can be suppressed.
>>
>> Certainly not a bug.
>
> Hmm, then again, I tend to agree with Cornell that there are a bit too
> many cases where mgp[1:3]' would sensibly have differing sign, compared
> to cases where it is a mistake. In addition to internal tick marks and
> labels, there are also cases where the whole axis is shifted into the
> plot area. I'd more likely use axis(pos=...) for that, but still.
>
And, I suppose, if R-Intro mentions it, it would be less confusing
if there were mention of the warning. But use of R conditions one to
seeing warnings as a good thing. Can't count the number of times
I've seen "longer ... is not a multiple of shorter ..." and having
it catch a silly user error.

--
Peter Ehlers
University of Calgary
403.202.3921

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel