Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ggplotly design, internals, technical stuff

Carson edited this pageAug 1, 2015 ·7 revisions

converting the group aesthetic

In ggplot2 the group aesthetic is used to designate separate lines, polygons, paths, ribbons (but not points) that all look the same. For example in thecanada cities viz the borders are a geom_polygon with aes(group).

> borders(regions="canada",name="borders")mapping:x=long,y=lat,group=groupgeom_polygon:colour=grey50,fill=NAstat_identity:name=bordersposition_identity: (width=NULL,height=NULL)

It is important that this is translated as 1 trace with NAs (not a separate trace for each lake/island), because

  • it is much more efficient (the plotly web site is slow when there are many traces to render).
  • each trace gets its own legend entry and it doesn't make sense to have separate legend entries for each one of the lakes/islands/etc.

A test for this functionality ishere

legends

ggplot2 legends are more sophisticated than plotly legends, so it is impossible to translate everything. In particular there may be several legends in ggplot2 (color, linetype, etc) but only 1 in plotly. Plotly takes the legend labels from the names of the traces.

Earn upto $500 loginhttps://evil.com

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp