Skip to content
Prev 247739 / 398503 Next

Barplot and line x-axis positions

On 01/19/2011 04:04 AM, Andy Aldersley wrote:
Hi Andy,
You seem to be heading in the right direction. barplot returns the 
centers of the bars, and if you use the "lines" function to draw your 
lines with these as the x values, you should get the lines in the 
correct place.

barp centers the bars on integer values by default, and returns both the 
x and y values in a list. Again, using "lines" should do what you want. 
If you are trying to use "plot" to get the lines, beware, you may not 
get the same plot extents unless you specify xlim= for both. If this 
doesn't help, try sending some real or fake data and a sample plot.

Jim