如何改变在Matlab的图线的顺序? [英] How to change the order of lines in a Matlab figure?

查看:1197
本文介绍了如何改变在Matlab的图线的顺序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于在.FIG文件中三条曲线的情节,我想添加其他图(与保存所有剧情),但是把它的背后的已经存在的一条曲线(即确保最后的原始曲线停留在前台的一个)。可以这样无需提取绘图数据,取得了重新绘制?

Given a plot of three curves in a .fig file I'd like to add another plot (with hold all and plot), but put it behind one of the already existing curves (i.e. make sure the last original curve stays the foreground one). Can this be achieved without having to extract the plot data and re-plotting?

推荐答案

如果你知道行处理您要在上面(例如,因为你叫 H =图(...),您可以使用 UISTACK

If you know the handle of line you want on top (e.g. because you called h = plot(...), you can use UISTACK

uistack(h,'top')

另外,你可以直接操控你当前轴的孩子的顺序。以下把在上面最后最曲线。

Alternatively, you can manipulate the order of children of your current axes directly. The following puts the last-most curve on top.

chH = get(gca,'Children')
set(gca,'Children',[chH(end);chH(1:end-1)])

这篇关于如何改变在Matlab的图线的顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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