# How to plot 3d data while using a gradient color depending on the "time" of the point?

**URL:** <https://discourse.julialang.org/t/how-to-plot-3d-data-while-using-a-gradient-color-depending-on-the-time-of-the-point/99988>\
**Category:** General Usage\
**Tags:** plotting, colors, plots\
**Created:** [June 7, 2023, 7:21am UTC](https://discourse.julialang.org/t/how-to-plot-3d-data-while-using-a-gradient-color-depending-on-the-time-of-the-point/99988 "2023-06-07T07:21:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ultrapoci](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ultrapoci/32/25356_2.png) [@ultrapoci](https://discourse.julialang.org/u/ultrapoci)\
**Post date:** [June 7, 2023, 7:21am UTC](https://discourse.julialang.org/t/how-to-plot-3d-data-while-using-a-gradient-color-depending-on-the-time-of-the-point/99988/1 "2023-06-07T07:21:13Z")

</div>

Sorry for the confusing title, I’m not really sure how to summarize it. Basically, I have a list of 3D points which are order according the time these points were taken. In a sense, you can think of these as 4D points, where one of the coordinates is time. It looks something like this:

![immagine](https://global.discourse-cdn.com/julialang/original/3X/f/3/f3d172264515fef67914016074636ac93d6eea75.png)

I would like for the time coordinate to be inferred using a gradient color of each point. I’m using `Plots.jl` and the only way I’ve found to do this is by passing a vector to the attribute `marker_z`. The problem is that I have 600 points, thus the vector passed to `marker_z` is of length 600: this completely breaks the `plotlyjs()` backend I’m using (which is useful because it lets me interact and rotate the 3D plot): the plot doesn’t load at all. It works for a handful of points, but in my case it is not viable.  
Is there a solution to this problem? Some other package or backend that lets me interact with the plot and have the points color respect the time series?

---

<div class="post-metadata">

**Author:** ![BambOoxX](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bambooxx/32/22179_2.png) [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Post date:** [June 7, 2023, 7:38am UTC](https://discourse.julialang.org/t/how-to-plot-3d-data-while-using-a-gradient-color-depending-on-the-time-of-the-point/99988/2 "2023-06-07T07:38:05Z")

</div>

I would say that [GLMakie](https://docs.makie.org/stable/documentation/backends/glmakie/) is your friend on this one !  
It can handle large amounts of data, while being interactive

---

<div class="post-metadata">

**Author:** ![cserteGT3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/csertegt3/32/8283_2.png) [@cserteGT3](https://discourse.julialang.org/u/cserteGT3)\
**Post date:** [June 7, 2023, 7:47am UTC](https://discourse.julialang.org/t/how-to-plot-3d-data-while-using-a-gradient-color-depending-on-the-time-of-the-point/99988/3 "2023-06-07T07:47:25Z")

</div>

600 points is not that much, PlotlyJS should handle that easily. Maybe try to use it directly, without the Plots.jl package. [Here](https://juliaplots.org/PlotlyJS.jl/stable/examples/3d/)’s the documentation for the 3d plot.
