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:
- normalised the data
- tried different opacity
- shifted the markers a negligible amount so they aren’t all overlapping
- Given different symbol and colours for the different sensor types
- 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)