plotly / plotly/plotly.R

Facet Axis Titles cut off on plotly's chart studio

Open
#1,380 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
2.7k
Forks
641
PR merge metrics
No merged PRs in 30d

Description

This issue is linked to this community post: https://community.plot.ly/t/ggplotly-renders-different-online-vs-offline/14989

When ggplot creates a facet plot, the labels are shared among the multiple axes. Because Plotly only has titles tied to individual axes, these labels are created using plotly annotations when the ggplot facet is ran through ggplotly

The annotations are aligned to the canvas. The yaxis label has a negative x coordinate, and the xaxis label has a negative y coordinate. The graph shows up fine in rstudio (or in chart creator) where more of the canvas is exposed:

image

But, when viewing in an iframe, the axis titles get cut off.

image

Can we find an alternative strategy to deal with axis titles on facet graphs? My first thought is to change the placement of the x and y axes relative to the canvas so there's room for the annotations at a 0 placement.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked community post and reproduce a faceted ggplot rendered through ggplotly inside an iframe, comparing it with the RStudio or chart creator view. Investigate how facet axis labels become annotations and define a strategy that keeps both axis titles visible without clipping; done means the titles render fully in the iframe.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.