Documentation of plotly说,使用参数 range 我们可以设置轴的限制,例如 range = [0, 10] 将轴最小值设置为0,最大值设置为10.根据文档,它可以在图形,布局,场景或x轴下使用 . 实际上 Scatter 和 Layout 接受 xaxis 和 yaxis 参数,它们是dicts或 plotly.graph_objs.XAxis 对象,并且可以提供 range 值 . 但是,通过尝试我能想象到的所有变化,它显然无法设置限制 . 此外,第一个子图似乎低于其他子图 . 请参阅下面的最低工作示例,该示例可以在任何Jupyter笔记本中运行 .
奖金问题:为什么 fill 的 fill 参数无法设置点的填充颜色?
import plotly
import plotly.tools
import plotly.graph_objs
plotly.offline.init_notebook_mode()
data = {
'A': {
'x': [1.0, 2.0, 6.0, 8.0],
'y': [34.0, 36.0, 38.0, 40.0],
's': [0.00416, 0.01125, 0.0038, 0.002]
},
'B': {
'x': [1.0, 1.0, 2.0, 2.0, 1.0, 2.0, 3.0, 2.0, 2.0, 3.0,
4.0, 2.0, 4.0, 5.0, 6.0, 7.0, 7.0],
'y': [30.0, 32.0, 32.0, 33.0, 34.0, 34.0, 34.0, 35.0,<