Python中plotly中的轮廓打印区域
我在图中画了一个数字,例如:Python中plotly中的轮廓打印区域,python,plotly,Python,Plotly,我在图中画了一个数字,例如: import plotly.plotly as py import plotly.graph_objs as go trace1 = go.Scatter( x=[1, 2, 3, 4, 5, 6, 7], y=[7, 6, 5, 4, 3, 2, 1] ) trace2 = go.Scatter( x=[1, 2, 3, 4, 5, 6, 7, 8], y=[1, 2, 3, 4, 5, 6, 7, 8] ) data = [tr
import plotly.plotly as py
import plotly.graph_objs as go
trace1 = go.Scatter(
x=[1, 2, 3, 4, 5, 6, 7],
y=[7, 6, 5, 4, 3, 2, 1]
)
trace2 = go.Scatter(
x=[1, 2, 3, 4, 5, 6, 7, 8],
y=[1, 2, 3, 4, 5, 6, 7, 8]
)
data = [trace1, trace2]
layout = dict(xaxis = dict(title = 'T (K)', showgrid=False, ticks='inside'),
yaxis = dict(title = 'normalized intensity', showgrid=False, ticks='inside'),
font=dict(size=18),
)
fig = go.Figure(data=data, layout=layout)
py.iplot(fig, auto_open=True, filename='test_fig.png')
py.image.save_as(fig, filename='test_fig.png')
这个数字看起来像:
我想要一个绘图区域的轮廓,如下所示:
但到目前为止,我还无法从plot.ly文档中找到答案。这可能吗?您只需找到另一个隐藏良好的Plotly属性。在这种情况下是这样的
mirror(枚举:True |“ticks”| False |“all”|“allticks”)
确定轴线或/和记号是否镜像到相反方向
绘图区域的侧面。如果为“真”,则将镜像轴线。如果
“记号”,轴线和记号被镜像。如果为“False”,则为镜像
是禁用的。如果为“全部”,则轴线将镜像到所有共享轴上
子地块。如果为“allticks”,则轴线和记号将在所有轴上镜像
共享轴子地块
加
到您的xaxis
和yaxis
dicts
,您将得到以下图表
在每个axis字典中设置
showline=True
将为您提供左行和底线,但不确定是否可以使用右行和右行。谢谢。我想说,对于编程库的方法/属性来说,“隐藏得很好”不是一个好的属性。@wordsforthewise:好吧,为了Plotly的辩护,它显示在示例页面上,但谷歌搜索对您没有帮助,因为缺少必要的关键字。
mirror=True,
ticks='outside',
showline=True,