Scatterplot with corner at (0, 0)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Scatterplot with corner at (0, 0)

Thomas L Jones
I have two vectors, x and y, and I want to create a scatterplot. I
want the lower left corner to be at (0, 0). I can create a scatterplot
just by calling plot (x, y), but I am quite throroughly stymied and
frustrated by the problem of putting the lower left corner at (0, 0),
despite many tries.

Thomas L. Jones, Ph.D., Computer Science

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Scatterplot with corner at (0, 0)

Nestor Arguea
> plot(x,y,xlim=c(0,max(x)),ylim=c(0,max(y)))

Nestor
On Monday 06 February 2006 10:10 pm, you wrote:

> I have two vectors, x and y, and I want to create a scatterplot. I
> want the lower left corner to be at (0, 0). I can create a scatterplot
> just by calling plot (x, y), but I am quite throroughly stymied and
> frustrated by the problem of putting the lower left corner at (0, 0),
> despite many tries.
>
> Thomas L. Jones, Ph.D., Computer Science
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html

--
Nestor M. Arguea, Chair
Department of Marketing and Economics
University of West Florida
11000 University Parkway
Pensacola, FL 32514
Phone: (850)474-3071
Fax: (850)474-3069

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Scatterplot with corner at (0, 0)

Prof Brian Ripley
On Mon, 6 Feb 2006, Nestor Arguea wrote:

>> plot(x,y,xlim=c(0,max(x)),ylim=c(0,max(y)))

You also need xaxs="i", yaxs="i"

>
> Nestor
> On Monday 06 February 2006 10:10 pm, you wrote:
>> I have two vectors, x and y, and I want to create a scatterplot. I
>> want the lower left corner to be at (0, 0). I can create a scatterplot
>> just by calling plot (x, y), but I am quite throroughly stymied and
>> frustrated by the problem of putting the lower left corner at (0, 0),
>> despite many tries.
>>
>> Thomas L. Jones, Ph.D., Computer Science
>
> --
> Nestor M. Arguea, Chair
> Department of Marketing and Economics
> University of West Florida
> 11000 University Parkway
> Pensacola, FL 32514
> Phone: (850)474-3071
> Fax: (850)474-3069


--
Brian D. Ripley,                  [hidden email]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Scatterplot with corner at (0, 0)

Jim Lemon-2
In reply to this post by Thomas L Jones
Thomas L Jones wrote:
 >
 > I have two vectors, x and y, and I want to create a scatterplot. I
 > want the lower left corner to be at (0, 0). I can create a scatterplot
 > just by calling plot (x, y), but I am quite throroughly stymied and
 > frustrated by the problem of putting the lower left corner at (0, 0),
 > despite many tries.

plot(x,y,xlim=c(0,max(x)),ylim=c(0,max(y)),xaxs="i",yaxs="i")

You may want to leave a bit of extra room at the higher values either
like this:

xlim=c(0,1.05*max(x))

or by using an arbitrary value that is above the maximum:

ylim=c(0,5)

Jim

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html