Removing perpendicular bars on the end of ggplot error bars

I am plotting a scatterplot with error bars on both axes. The data is in a table file with columns x, y, SEy, SEx, and color (and some extraneous stuff).

comp    source2 y   SEy source1 x   SEx color alpha   popA    0.09    0.0011  pop1    0.09    0.0011  blue beta    popA    0.21    0.0011  pop1    0.22    0.0011  blue gamma   popA    0.15    0.0011  pop1    0.15    0.0011  blue delta   popA    0.09    0.0011  pop1    0.091   0.0011  blue alpha   popB    0.094   0.0011  pop1    0.092   0.0011  green beta    popB    0.23    0.0011  pop1    0.24    0.0011  green gamma   popB    0.156   0.0011  pop1    0.166   0.0011  green delta   popB    0.08    0.0011  pop1    0.092   0.0011  green 

(Normally each x/y has a unique SE, these are just made-up numbers here)

read.table("junk.txt", header = TRUE) -> tbl require(ggplot2) ggplot(data = tbl,aes(x = x,y = y)) +    geom_point(colour=tbl$color) +     geom_errorbar(aes(ymin = y-SEy,ymax = y+SEy,height=0)) +    geom_errorbarh(aes(xmin = x-SEx,xmax = x+SEx,height=0)) +   geom_abline(intercept = 0, slope = 1) 

Height is set to zero, but I am still getting perpendicular bars on y-axis error bars. What is going on here? (Also, on a tangential bonus question, how can I get the error bars to have the same color as the points?)

Removing perpendicular bars on the end of ggplot error bars

Replay

Category: r Time: 2016-01-26 Views: 2
Tags: ggplot2

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.111 (s). 12 q(s)