Re: [R] Labels for matplot x axis

From: Jim Lemon <>
Date: Tue, 22 Jun 2010 21:48:41 +1000

On 06/22/2010 08:05 PM, Nick Torenvliet wrote:
> Hi all, I've been messing with this for a while now..
> myStudy is a matrix of word frequency to date of document/document.
> As you can see I'm trying to plot the series in the matrix.
> I'd like three things --
> 1- In the plot that gets created the first series is a solid line, the rest
> are dashed... how do I make them either one or the other.


> 2- The legend that comes up has filled boxes with colour as legend keys,
> I'd like to show coloured lines for legend keys instead.

specify col=("blue","red","green"),lty=1 instead of fill()

> 3- The x axis of the plot come up labelled 0-80 with major intervals of
> twenty, I'd like to see (@45 degrees) the axis labelled with the rownames
> of myStudy, and I'd like to be able to control the interval at which these
> major ticks are displayed.

try staxlab(1,at=1:95,labels=rownames(myStudy),srt=45,cex=0.5) but you will want to stretch the plot out horizontally and adjust the "cex" argument to get the best readability.

Jim mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Tue 22 Jun 2010 - 11:46:30 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 22 Jun 2010 - 21:50:34 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive