USGS-R / gsplot

plotting foundation for timeseries reporting
Other
6 stars 14 forks source link

legend is weird with numeric + non-numeric point types #399

Open lindsayplatt opened 8 years ago

lindsayplatt commented 8 years ago

When you mix point types and try to add a legend, the legend looks funny.

gs <- gsplot() %>% 
    points(1,1, pch=2, legend.name="stuff") %>% 
    points(1,2, pch=25, legend.name="more stuff") %>%
    legend()
gs

image

gs <- gsplot() %>% 
    points(1,1, pch="o", legend.name="stuff") %>% 
    points(1,2, pch=25, legend.name="more stuff") %>%
    legend()
gs

image

jordansread commented 8 years ago

Same code different pkg version? Or did I miss the difference in the code?

lindsayplatt commented 8 years ago

First one has both numeric pch, the second has one with "o" which is a valid pch. Just makes legend freak out

lindsayplatt commented 8 years ago

Hmm this is actually also a problem with base: http://stackoverflow.com/questions/13453104/r-legend-pch-mix-of-character-and-numeric

lindsayplatt commented 8 years ago

@mhines-usgs pointed out that they are using ascii codes so each of the character options does have a numeric equivalent. The question is, should we expect users to figure this out, or should gsplot handle this in the background and convert characters to their ascii code?

http://www.columbia.edu/kermit/ascii.html

jordansread commented 8 years ago

wontfix for now?

lindsayplatt commented 8 years ago

@jiwalker-usgs thinks we should handle this and do an ASCII lookup or something where we are adding pch to legend (which would be in get_legend_args)

lindsayplatt commented 8 years ago

@jread-usgs going to say "for later" or "enhancement" instead

jordansread commented 8 years ago

Either way sounds fine to me :+1:

mhines-usgs commented 8 years ago

★░░░░░░░░░░░████░░░░░░░░░░░░░░░░░░░░★ ★░░░░░░░░░███░██░░░░░░░░░░░░░░░░░░░░★ ★░░░░░░░░░██░░░█░░░░░░░░░░░░░░░░░░░░★ ★░░░░░░░░░██░░░██░░░░░░░░░░░░░░░░░░░★ ★░░░░░░░░░░██░░░███░░░░░░░░░░░░░░░░░★ ★░░░░░░░░░░░██░░░░██░░░░░░░░░░░░░░░░★ ★░░░░░░░░░░░██░░░░░███░░░░░░░░░░░░░░★ ★░░░░░░░░░░░░██░░░░░░██░░░░░░░░░░░░░★ ★░░░░░░░███████░░░░░░░██░░░░░░░░░░░░★ ★░░░░█████░░░░░░░░░░░░░░███░██░░░░░░★ ★░░░██░░░░░████░░░░░░░░░░██████░░░░░★ ★░░░██░░████░░███░░░░░░░░░░░░░██░░░░★ ★░░░██░░░░░░░░███░░░░░░░░░░░░░██░░░░★ ★░░░░██████████░███░░░░░░░░░░░██░░░░★ ★░░░░██░░░░░░░░████░░░░░░░░░░░██░░░░★ ★░░░░███████████░░██░░░░░░░░░░██░░░░★ ★░░░░░░██░░░░░░░████░░░░░██████░░░░░★ ★░░░░░░██████████░██░░░░███░██░░░░░░★ ★░░░░░░░░░██░░░░░████░███░░░░░░░░░░░★ ★░░░░░░░░░█████████████░░░░░░░░░░░░░★ ★░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░★