plotly / plotly/plotly.R

3D scatter plot axis disappears when using constant large integers

Open
#1,765 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

There seems to be an issue with plotting constant Sys.time() in the 3d scatter plot. It is not only restricted to Sys.time() but in general to large integer numbers. You can also replace it with 1589393061. The y axis just disappears. Below I show a bad plotting and a good plotting when using the format function. Is this a bug?

library(plotly)
data_bad<-data.frame(x=c(1,2,3,4,5),
                     y=rep(Sys.time(),5),
                     z=c(3,2,5,23,6),
                     w=c("a","a","b","b","c"))

p_bad <- plot_ly(data_bad, x=~x, y =~y , z =~z, color = ~w, 
                 type="scatter3d", mode="markers")
p_bad

data_bad2<-data.frame(x=c(1,2,3,4,5),
                     y=rep(1589393061,5),
                     z=c(3,2,5,23,6),
                     w=c("a","a","b","b","c"))

p_bad2 <- plot_ly(data_bad2, x=~x, y =~y , z =~z, color = ~w, 
                 type="scatter3d", mode="markers")
p_bad2

data<-data.frame(x=c(1,2,3,4,5),
                 y=rep(format(Sys.time(), "%Y-%M-%D %H:%M:%S"),5),
                 z=c(3,2,5,23,6),
                 w=c("a","a","b","b","c"))
p <- plot_ly(data, x=~x, y =~y , z =~z, color = ~w, 
             type="scatter3d", mode="markers")
p

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 by running the reproducible R examples from the issue, comparing the 3D scatter plot with constant Sys.time(), the large integer 1589393061, and the formatted value. Trace the plotly.R 3D scatter rendering path and identify why the y-axis disappears for large numeric values; done means the axis remains visible for these cases without breaking the formatted example.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.