如何使用 Plotly 控制哪些跟踪图位于顶部? [英] How do I control which trace plots on top with Plotly?

查看:63
本文介绍了如何使用 Plotly 控制哪些跟踪图位于顶部?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Plotly python 库生成一个带有几个小提琴图和几个填充散点图的图形.无论我的代码中的各个 fig.add_trace 调用的顺序如何,小提琴图总是在散点图后面绘制.

I'm using the Plotly python library to generate a figure with several violin plots and several filled scatter plots. No matter what order I have the individual fig.add_trace calls in my code, the violin plots always plot behind the scatter plots.

有谁知道是否有控制布局或绘图顺序的特定方法?类似 zorder=3 的东西?

Does anyone know if there is a specific method for controlling layout or plot order? Something like zorder=3?

推荐答案

目前你可以通过对数据数组中的跟踪对象进行排序来控制跟踪类型内的跟踪顺序,但不能跨跟踪类型,所以小提琴总是会拖后分散.

At the moment you can control trace order within trace types by ordering the trace objects in the data array, but not across trace types, so violins will always draw behind scatters.

这篇关于如何使用 Plotly 控制哪些跟踪图位于顶部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆