plotly / plotly/plotly.R

Extra (unwanted) geoms in the legend

Đang mở
#572 13 bình luận 3 reaction 1 người được giao Xem trên GitHub

@moutikabdessabour đang làm issue này rồi.

Từ ngày 30/9/2021.

bug ggplotly
Ngôn ngữ chính
R
Star
2.7k
Fork
641
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

The code:
library(plotly)

dat1 <- data.frame(
  sex = factor(c("Female","Female","Male","Male")),
  time = factor(c("Lunch","Dinner","Lunch","Dinner"), levels=c("Lunch","Dinner")),
  total_bill = c(13.53, 16.81, 16.24, 17.42)
)

ggplot(data=dat1, aes(x=time, y=total_bill, group=sex, shape=sex, colour=sex)) +
  geom_line(aes(linetype=sex), size=1) +     # Set linetype by sex
  geom_point(size=5) +         # Use larger points, fill with white
  scale_colour_hue(name="Sex",      # Set legend title
                   l=30)  +                  # Use darker colors (lightness=30)
  scale_shape_manual(name="Sex",
                     values=c(22,21)) +      # Use points with a fill color
  scale_linetype_discrete(name="Sex") +
  xlab("Time of day") + ylab("Total bill") + # Set axis labels
  ggtitle("Average bill for 2 people") +     # Set title
  theme_bw()

ggplotly()
The ggplot version:

image

The ggplotly version:

screen shot 2016-05-04 at 5 46 01 pm

Session Info:

sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.9.4 (Mavericks)

locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] plotly_3.4.13 ggplot2_2.1.0

loaded via a namespace (and not attached):
[1] Rcpp_0.12.4 tidyr_0.4.1 assertthat_0.1 dplyr_0.4.3
[5] digest_0.6.9 grid_3.2.3 plyr_1.8.3 R6_2.1.2
[9] DBI_0.3.1 jsonlite_0.9.19 gtable_0.2.0 magrittr_1.5
[13] scales_0.4.0 httr_1.1.0 viridis_0.3.4 labeling_0.3
[17] tools_3.2.3 htmlwidgets_0.6 munsell_0.4.3 yaml_2.1.13
[21] parallel_3.2.3 base64enc_0.1-3 colorspace_1.2-6 htmltools_0.3.5
[25] gridExtra_2.2.1

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.