How to make brush ignore certain variables
2 views (last 30 days)
Show older comments
Hi there,
I am required to manually filter a large amount of data over multiple years. I would like to plot two variables at once, the "raw" data in red, then the "clean" data in blue. I would like to be able to modify the "clean" data with the brush tool without modifying the "raw" data (so that any changes I make are clearly visible). For example:
%imagine
x = 1:5;
y_raw = rand(5,1)
y_clean = y_raw
%notice the "clean" and "raw" data are the same initially,
%I would like to overlay them and use the brush tool to manually remove outliers
%from the "clean" variable, then save the new "clean" points.
plot(x,y_raw,'-or')
hold on
plot(x,y_clean,'-ob')
brush on
Afterwards, I would save the clean values with "save y_clean.mat y_clean"
The brush works on the "clean" blue variables if I only select one point at a time. However, I want to select many points at once by clicking and dragging the brush over the plot. Unfortuntely, this selects all the data and not just the top y_clean (blue) values. I have tried this:
a = plot(x,y_raw,'-or')
hold on
b = plot(x,y_clean,'-ob')
brush(a,'on')
but no luck. Thanks a ton!
-Devon
0 Comments
Answers (0)
See Also
Categories
Find more on Direct Search in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!