# Issue with date time xaxis in 3d plot

**URL:** <https://community.plotly.com/t/issue-with-date-time-xaxis-in-3d-plot/42103>\
**Category:** Plotly R\
**Created:** [July 7, 2020, 1:07pm UTC](https://community.plotly.com/t/issue-with-date-time-xaxis-in-3d-plot/42103 "2020-07-07T13:07:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![HansPeter123](https://avatars.discourse-cdn.com/v4/letter/h/3be4f8/32.png) [@HansPeter123](https://community.plotly.com/u/HansPeter123)\
**Post date:** [July 7, 2020, 1:07pm UTC](https://community.plotly.com/t/issue-with-date-time-xaxis-in-3d-plot/42103/1 "2020-07-07T13:07:01Z")

</div>

Hi, I need to do a 3d scatter plot.

This is a screenshot of the plot:

 ![Bildschirmfoto 2020-07-07 um 14 51 44](https://user-images.githubusercontent.com/67552385/86784152-7bd2e180-c061-11ea-807e-965ef19335a6.png)

As you can see the xaxis with the date time is not correctly displayed. If I move the plot around it shows a strange ‘shaky’ behavior and the lines somehow are displayed ‘zigzag like’.  
The second screenshot is basically the same. I just used dense\_rank() on the date time column and then displayed the resulting order. This leads to a correct plot.

 ![Bildschirmfoto 2020-07-07 um 14 51 55](https://user-images.githubusercontent.com/67552385/86784175-81c8c280-c061-11ea-96df-63362dc23d0e.png)

Is there a fix/ solution for the first plot i.e. that it looks like the second plot but displays the date times instead of the dense\_rank() order as xaxis?  
Thank you very much.

Code first plot:  
`p1 <- plot_ly( df_sub, x=~datetime, y=~y, z=~z, color = ~color, colors = col ) `  
Code second plot:  
`p1 <- plot_ly( df_sub, x=~order, y=~y, z=~z, color = ~color, colors = col ) `

Layout for both plots:  
`p1 %>% layout( scene=list( camera = list(eye = list(x = -2.5, y = 0, z = 0)), xaxis = list(title = "x"), yaxis = list(title = "y", autorange = "reversed"), zaxis = list(title = "z"), aspectratio = list(x = 1.2, y = 1.2, z = 1.2)), paper_bgcolor='rgb(19,20,23)', uirevision=T, showlegend=T ) %>% group_by(group_var) %>% add_lines`
