Hi @wujire
Here’s a general approach to looping over the x/y axis objects (see the last three lines below)
from plotly import tools
import plotly.plotly as py
import plotly.graph_objs as go
trace1 = go.Scatter(
x=[1, 2, 3],
y=[4, 5, 6],
mode='markers+text',
text=['Text A', 'Text B', 'Text C'],
textposition='bottom center'
)
trace2 = go.Scatter(
x=[20, 30, 40],
y=[50, 60, 70],
mode='markers+text',
text=['Text D', 'Text E', 'Text F'],
textposition='bottom center'
)
fig = tools.make_subplots(rows=1, cols=2, print_grid=False)
fig.append_trace(trace1, 1, 1)
fig.append_trace(trace2, 1, 2)
for prop in fig.layout:
if prop.startswith('xaxis') or prop.startswith('yaxis'):
print(fig.layout[prop])
layout.XAxis({
'anchor': 'y', 'domain': [0.0, 0.45]
})
layout.YAxis({
'anchor': 'x', 'domain': [0.0, 1.0]
})
layout.XAxis({
'anchor': 'y2', 'domain': [0.55, 1.0]
})
layout.YAxis({
'anchor': 'x2', 'domain': [0.0, 1.0]
})
I don’t think it’s possible to rotate axis titles unfortunately.
Hope that helps
-Jon