✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

Scatter3D plot - Improving readability - Feedback / Pro tips

Hi Community,

Anyone have any pro tips or want to give feedback on how they improve readability of a scatter 3D plot with multiple columns?

Example:

I am reading three sensor columns of data that all overlap. So far I’ve:

  1. normalised the data
  2. tried different opacity
  3. shifted the markers a negligible amount so they aren’t all overlapping
  4. Given different symbol and colours for the different sensor types
  5. Added colour outlines

Still looks pretty average.

Anyone else done a better job or can provide advice?

import dash
from dash.dependencies import Output, Input, State
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import plotly.express as px
from dash.exceptions import PreventUpdate
import numpy as np
import pandas as pd

# Read data from a csv
# Headers:
# latitude,longtitude,depth,Copper,Mg,Al,Ph,utm_X,utm_Y,utm,Copper_size,Mg_size,Al_size,Ph_size
df = pd.read_csv('https://raw.githubusercontent.com/roboticsmick/data_analyse/main/data/scatter_test.csv')

# # Normalise readings
# df["Copper_size"] = 10*(df['Copper'] - df['Copper'].min()) / (df['Copper'].max() - df['Copper'].min())
# df["Mg_size"]= 10*(df['Mg'] - df['Mg'].min()) / (df['Mg'].max() - df['Mg'].min())
# df["Al_size"]= 10*(df['Al'] - df['Al'].min()) / (df['Al'].max() - df['Al'].min())
# df["Ph_size"]= 10*(df['Ph'] - df['Ph'].min()) / (df['Ph'].max() - df['Ph'].min())

# Plot figure
layout=go.Layout(height=800, width=800)
fig = go.Figure(layout=layout)
fig.add_scatter3d(name='Copper',
    x=df["utm_X"]+0.5,
    y=df["utm_Y"]+0.5,
    z=df["depth"]+0.3,
    mode='markers',
    marker=dict(
        size=df["Copper_size"],
        symbol="diamond",
        opacity=0.5,
        color='blue',
        line=dict(width=2,color='white')))

fig.add_scatter3d(name='Mg',
    x=df["utm_X"],
    y=df["utm_Y"],
    z=df["depth"],
    mode='markers',
    marker=dict(
        size=df["Mg_size"],
        symbol="circle",
        opacity=0.5,
        color='red',
        line=dict(width=2,color='white')))


fig.add_scatter3d(name='Al',
    x=df["utm_X"]-0.5,
    y=df["utm_Y"]-0.5,
    z=df["depth"]-0.3,
    mode='markers',
    marker=dict(
        size=df["Al_size"],
        symbol="square",
        opacity=0.5,
        color='green',
        line=dict(width=2,color='white')))

app = dash.Dash(__name__)
app.layout = html.Div(
    [# Plot figure
    dcc.Graph(id='graph', figure=fig),
    ]
)
if __name__ == '__main__':
    app.run_server(debug=True)