[R] [sm.density.compare] scale up y-axis and additional line type

Jim Lemon jim at bitwrit.com.au
Tue Oct 1 06:00:50 CEST 2013


On 10/01/2013 08:17 AM, Xianwen Chen wrote:
> Dear fellows,
>
> The two questions are on sm.density.compare(). I compare kernel density
> estimates of two arrays of data.
>
> I'd like to scale up y-axis so that I can show better the differences in
> y values. English is not my first language so I'll try to explain it. I
> would like to stretch y-axis a bit longer but not to change the range of
> y values. How can I do this?
>
> Second, I'm using a solid line for one array of date and a dashed line
> for another array of data. The difference is not easy to see, because
> the two curves are approximate to some degree. Is it possible to plot
> one array of data with *, instead of dash?
>
Hi Xianwen,
You can specify the width and height of the graphics device:

dev.new(height=9)

OR

png("myplot.png",height=600)

or some other type of device. This will produce a plot that is 
noticeably higher than it is wide. For the second question, try:

lty=3,lwd=3

Jim



More information about the R-help mailing list