How to brush data automatically?
12 次查看(过去 30 天)
显示 更早的评论
On the "Figure Editor" window there is button "brush/select data". Also command >>brush exists. This effects in case: >>fplot('x^2',[0 1]), as noted in help on this command. But no effect (to remark part of graph by color) here: >>F=inline('x*cos(y)+2*y*cos(x)-1./(2*x+y)');ezplot(F)
Why?
And also question: For curve y(x) or r(t) (2 or 3D), how to remark (without marker, only color) a parts of curve by program way (without mouse)? For example, for parabola on abscissa [0;1]-red,[1;2]-orange,... but using one line-obiect, that is, parabola has already given as whole.
0 个评论
回答(2 个)
Sarah Wait Zaranek
2011-5-25
Only certain plots can be brushed. The doc has list here of what you can and can't brush: http://www.mathworks.com/help/releases/R2011a/techdoc/ref/brush.html#brhzjsn
ezplot isn't explicitly listed in the can't brush list - but plots like it are listed.
In the second question, you are just turning the interactive brush functionality on by using the command brush. You aren't actually picking any points to be brushed.
If you want to actually set the brush data programatically, you need to go into the objects and set the data here.
hB = findobj(gcf,'-property','BrushData');
set(hB,'BrushData', YourNewValues')
By default if you have nothing highlighted, it will be a vector of all zeros. Brush Data has the same length as X (or Y) and is a vector of 1s or 0s (not logical, i think actually uint8) that has a 1 if you want that point brushed or a zero if you don't).
You can see what it looks like by doing the following:
get(hB,'BrushData');
5 个评论
Sarah Wait Zaranek
2011-5-26
Brush Data has the same length as X (or Y) and is a vector of 1s or 0s (not logical, i think actually uint8) that has a 1 if you want that point brushed or a zero if you don't). You can see what it looks like by doing the following:
get(hB,'BrushData');
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Specifying Target for Graphics Output 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!