- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我必须在图表中绘制 3 个不同 channel 的脑电图数据。我想将它们全部绘制在一个图中,并用水平线分隔。所有 channel 共用的 X 轴。
我可以使用 add_axes 轻松完成此操作。但我想画一条与这些轴相交的垂直线。但我做不到。
目前,我的示例代码如下所示。
from pylab import figure, show, setp
from numpy import sin, cos, exp, pi, arange
t = arange(0.0, 2.0, 0.01)
s1 = sin(2*pi*t)
s2 = exp(-t)
s3 = 200*t
fig = figure()
t = arange(0.0, 2.0, 0.01)
yprops = dict(rotation=0,
horizontalalignment='right',
verticalalignment='center',
x=-0.1)
axprops = dict(yticks=[])
ax1 =fig.add_axes([0.1, 0.5, 0.8, 0.2], **axprops)
ax1.plot(t, s1)
ax1.set_ylabel('S1', **yprops)
axprops['sharex'] = ax1
#axprops['sharey'] = ax1
# force x axes to remain in register, even with toolbar navigation
ax2 = fig.add_axes([0.1, 0.3, 0.8, 0.2], **axprops)
ax2.plot(t, s2)
ax2.set_ylabel('S2', **yprops)
ax3 = fig.add_axes([0.1, 0.1, 0.8, 0.2], **axprops)
ax3.plot(t, s3)
ax3.set_ylabel('S3', **yprops)
# turn off x ticklabels for all but the lower axes
for ax in ax1, ax2:
setp(ax.get_xticklabels(), visible=False)
show()
我希望我的最终图像如下所示。在我当前的输出中,我可以获得没有绿色垂直线的相同图表。
有人可以帮忙吗???我不想使用子图,也不想为每个轴添加 axvline 。
谢谢你,托塔德里
最佳答案
使用
vl_lst = [a.axvline(x_pos, color='g', lw=3, linestyle='-') for a in [ax1, ax2, ax3]]
更新每一帧:
new_x = X
for v in vl_lst:
v.set_xdata(new_x)
关于python - 在 matplotlib 的图中添加与 3 个不同轴相交的垂直线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16682802/
我想在80个字符处添加一个标尺。我知道您可以add rulers to CodeMirror,但是我不知道是否应该将the corresponding javascript放在文件中的某个位置,或者放
我正在使用plotly包,并尝试向图形添加水平线。有什么办法使用plotly吗? 可以使用ggplot2和ggplotly函数完成此操作,如下所示: library(plotly) p % add
我想在 org.eclipse.xtext.ui.editor.embedded.EmbeddedEditor 中的 120 个字符后显示一条垂直线(Eclipse 措辞中的打印边距)。这是否以某种方
我的想法是制作一个几乎像 Lollipop 一样的圆圈(在我的例子中是一个矩形)的底部有一条无限长的垂直线。我读到这可以使用 css :after 来完成,但是 psuedoelements 确实限制
我正在尝试使用 Bootstrap 在中间设置一 strip 有按钮的垂直线。 使用Bootstrap简单竖线:
我想知道如何用一条直线连接两个 div 元素,这条直线的距离有点像本网站中的那条线: JSFiddle link: https://jsfiddle.net/mcbvb8m2/ 对于水平和垂直 div
我有一个数字类型的输入,我应该将输入的值格式化为返回字符串的特定格式,因此作为解决方案,我添加了第二个字符串类型的输入并隐藏了输入 [type=number] 但用户只看到输入 [type=strin
我正在尝试创建一个教育时间表。应该有一条垂直线(红色)从“毕业帽”后面开始,然后穿过所有时间线后(绿色)。 这是我到目前为止得到的: .iconspace { position: relati
对于给定的矩形 R1 我试图找出哪些是可以与其相交的其他矩形 IF 我画了一个 vector 线段。 与 R1 相交的矩形标记为红色。 每个矩形都由其(top, left) 和(bottom, rig
我想知道是否可以激活悬停在图形上方的垂直线并突出显示点? 例如,在此图中:http://www.highcharts.com/stock/demo/compare ->将鼠标悬停在图形线上时,每个系列
我需要在我的图文上放置一 strip 有标签的垂直线,例如本例中的国庆节线 - http://www.fusioncharts.com/dev/chart-attributes.html?chart=
IE11不支持播放作品音频文件。这就是为什么我使用 ogv.js javascript库在IE11中播放它的原因。该库将音频数据流传输到IE11的内部Flash Player并进行播放。问题是在并行播
我在 android 中使用 achartengine 图形库制作折线图。有人可以建议我放置十字准线(当用户触摸图表时在所有数据点上移动的垂直线)我的要求符合这样的实现 http://www.jqch
我正在为子菜单项制作 TreeView ,我快完成了。最后一个元素的问题,现在看起来如何: 我想看起来像: DEMO HTML: Example 1
如何像此处那样在我的网页边框周围创建边框? http://www.callieschweitzer.com/ 我尝试做一条水平线,但很难将其与垂直线对齐……不过我觉得有一种更简单的方法。有什么想法吗?
这个问题在这里已经有了答案: What does the vertical pipe ( | ) mean in C++? (4 个答案) 关闭 5 年前。 我用了双竖“||”作为 bool “或”
我使用 Pandoc (http://johnmacfarlane.net/pandoc/README.html) 及其 Markdown 处理器。当我使用 Pandoc 将下面的网格转换为 PDF(
谁能告诉我如何扩展 Chart.js v2.0。我需要折线图中的垂直线,我想实现类似于 http://jsfiddle.net/dbyze2ga/ 的东西. Chart.types.Line.exte
我已经创建了一个自定义通知 XML 文件。我想画一条垂直线,就像下图中的水平线一样。我一直在尝试各种方法无法实现它。 xml 中从水平到垂直的方向对我没有帮助。 查看下面的屏幕截图:我想要垂直线而不是
如何使用标准图像处理过滤器(来自 OpenCV)从图像中去除长水平和垂直线? 图像是黑白的,所以删除意味着简单地涂成黑色。 插图: 我目前正在用 Python 执行此操作,遍历像素行和列并检测连续像素
我是一名优秀的程序员,十分优秀!