2017-08-25 2 views
0

Wie entferne ich die Zahlen und Ticks von der internen y-Achse in der Plot.ly Heatmap Subplot graph below? Beide Diagramme teilen sich den gleichen y-Achsenbereich, so dass es keinen Grund gibt, beides anzuzeigen.Python Plotly Heatmap Unterplots - entfernen interne y-Achsen-Nummern und Ticks

import plotly.plotly as py 
import plotly.graph_objs as go 
from plotly import tools 


import pandas as pd 
import numpy as np 


dfl = [] 

dfl.append(pd.DataFrame(np.random.random((100,100,)))) 
dfl.append(pd.DataFrame(np.random.random((100,100,)))) 


fig = tools.make_subplots(rows=1, cols=len(dfl) ,print_grid=False); 

for index, a in enumerate(dfl): 

    sn = str(index) 

    data = go.Heatmap(
      z=a.values.tolist(), 
      colorscale='Viridis', 
      colorbar=dict(title='units'), 
     ) 

    fig.append_trace(data, 1, index+1) 
    fig['layout']['xaxis'+str(index+1)].update(title='xaxis '+str(index)) 

fig['layout']['yaxis1'].update(title='y-axis') 
fig['layout'].update(height=600, width=800, title='heatmap subplots') 
py.iplot(fig) 

Heatmap subplots

Antwort

0

einfach die Einstellung passieren 'shared_yaxes = True' zum tools.make_subplots Funktionsaufruf, das heißt:

fig = tools.make_subplots(rows=1, cols=len(dfl) ,print_grid=False, shared_yaxes=True) 
Verwandte Themen