[R] barplot problem

R. Michael Weylandt michael.weylandt at gmail.com
Sun May 27 05:31:27 CEST 2012


It sounds like you want something of the form

plot(distance, data, type = "h")

But the lines might be too thin: try adding lwd = NUM to increase the
thickness.

Hope this helps,
Michael

On Sat, May 26, 2012 at 11:26 PM, jack hietpas <mikroskop at gmail.com> wrote:
> Hello- I am having trouble making a barplot...
>
> The y-values are:
> data=c(-0.0002129061,0.0000000000,-0.0002699561,0.0163883061,0.0400000000).
>
> The x-values are distance=c(0, 71, 172, 206, 292).
> The desired x-range is 0 and ~300+ (kilometers), range=seq(0,300,1)
>
> I would like to make a bar plot with the bar locations along the x-axis
> spaced according to their distances.
>
> I have tried barplot(distance, data)... but this produces a very strange
> plot.
>
> plot(distance, data) is almost correct, except it is a scatter plot.
>
> Thanks for any help you can provide, I must be missing something very
> obvious.
>
> Take care,
>
> -jh
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list