Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

3D Surface, data range and labels

Hi folks!

I am trying to plot a 3D surface, and I am having troubles:

  • Defining a range for labels (X/Y) ; in the example below, I’d like to have B1-K1 for X and A2-A7 for Y. But it seems that I need to copy the labels in a dedicated column (?)
  • Defining a range for data ; in the example below, I’d like to define B2-K7, but in the GUI, I need to click on every column manually

Any thoughts ? :slight_smile: Thanks!

Example: dataset with sizes from 32 to 524288, and number of clients from 4 to 128

32	1024	2048	4096	16384	32768	65536	131072	262144	524288

4 205376 5908480 11704320 22970368 83820544 150700032 175702016 167903232 170131456 164102144
8 459360 15010816 29206528 55320576 168263680 178126848 174850048 170786816 169345024 164102144
16 725920 22535168 43094016 80838656 179666944 176390144 173670400 170786816 166985728 162004992
32 883904 27205632 44500992 98275328 176095232 175079424 171966464 170786816 166723584 160432128
64 927680 28759040 42219520 100302848 154632192 174489600 170852352 170393600 166985728 159907840
128 943168 26960896 40572928 99078144 139427840 173473792 169607168 169345024 166461440 157810688

Okay, so this does not seem to be possible with the GUI

This can, however, be done through the API:

import plotly.plotly as py
import plotly.graph_objs as go
import pandas as pd

Read data from a csv

z_data = pd.read_csv(‘sample.csv’, header=0, index_col=0)

data = [
go.Surface(
x=z_data.axes[0],
y=z_data.axes[1],
z=z_data.as_matrix()
)
]
layout = go.Layout(
title=‘Sample’,
scene=dict(
xaxis=dict(title=‘X Axis’),
yaxis=dict(title=‘Y Axis)’),
zaxis=dict(title=‘Z Axis)’)
),
autosize=False,
width=500,
height=500,
margin=dict(
l=65,
r=50,
b=65,
t=90
)
)
fig = go.Figure(data=data, layout=layout)
url = py.plot(fig, filename=‘sample’)