r - Symbol with white background in plot legend (pt.bg has no effect) -


i'm trying add legend plot, cannot pch symbol fill white. pt.bg seems have no effect:

plot(1, 1) legend(     x = "topright",     legend = c("alle messzeitpunkte", "ohne selbstinitiierte", "erwartete"),     lty = c("solid", "dashed", "dotted"),     pch = c(16, 1, na),     pt.bg = c("black", "white", na) ) 

enter image description here

pch = 1 empty circle , cannot filled. pch = 16 filled shape without border. color both pch = 1 , pch = 16 defined col. pch = 21 can filled color different border color. color of filling of pch = 21 defined bg in many plotting functions , pt.bg in legend().

plot(1:10, rep(1, 10), ylim = c(0, 2), axes = false) legend(     x = 1, y = 2,     legend = c("a", "b", "c", "d", "e"),     lty = "solid",     pch = c(1, 1, 1),     col = c("black", "black", "red", "red", "red"),     pt.bg = c("black", "white", "red", "green", "blue") ) legend(     x = 2.5, y = 2,     legend = c("a", "b", "c", "d", "e"),     lty = "solid",     pch = c(16, 16, 16),     col = c("black", "black", "red", "red", "red"),     pt.bg = c("black", "white", "red", "green", "blue") ) legend(     x = 4, y = 2,     legend = c("a", "b", "c", "d", "e"),     lty = "solid",     pch = c(21, 21, 21),     col = c("black", "black", "red", "red", "red"),     pt.bg = c("black", "white", "red", "green", "blue") ) 

enter image description here


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -