Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You've received some good solutions to your immediate problem, but I thought I'd answer the "Why?" portion. R's documentation in this instance is correct, but perhaps not as transparent as it could be.</p> <p>If you examine the section of <code>?par</code> describing <code>xaxp</code>, you'll find:</p> <blockquote> <p>This parameter is reset when a user coordinate system is set up, for example by starting a new page or by calling plot.window or setting par("usr"): n is taken from par("lab").</p> </blockquote> <p>Under <code>yaxp</code>, the same warning is not given, but instead it says simple 'See <code>xaxp</code>'. There is no similar warning for the <code>usr</code> parameter in <code>?par</code>, but the same is probably the case, since if we look up <code>?plot.window</code> we see:</p> <blockquote> <p>A side-effect of the call is to set up the usr, xaxp and yaxp</p> </blockquote> <p>So what's happening is that a call to <code>plot</code> eventually leads to calling <code>plot.window</code>, a side effect of which is to actually <em>reset</em> the settings for <code>usr</code>, <code>xaxp</code> and <code>yaxp</code>. Unless, of course, you have passed those arguments directly to a higher level function like <code>plot</code> that in turn hands them off down the line to <code>plot.window</code>.</p> <p>Personally, I think this deserves mention in the Details section of <code>?par</code> along with the list of parameters that can <em>only</em> be set by using <code>par()</code> rather than passing them to high level plotting functions.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload