How to make certain values zero of a plotted fit object.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Thomas Carter
am 30 Sep. 2021
Beantwortet: Thomas Carter
am 13 Okt. 2021
I have plotted a "fit" object of a 3d matrix to provide a surface profile with the convenient spreadsheet type look. Each one represents a bioloigcal sample. There are some that fail and I would like color these black. I cannot access the data after "fit" has been done and I cannot "fit" data after making the failed cells=0. I altered the image in imagej to show an example of what I am hoping for.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/755324/image.jpeg)
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 1 Okt. 2021
Record the fit object, say F . Do not ask to plot the fit object.
Now invoke the fit object on the data
[X, Y] = ndgrid(linspace(0,2000,47),0:8:400);
prediction = reshape(F(X(:), Y(:)), size(X));
Now...
ADmask = ones(size(prediction));
Now assign ADmask to 0 at the places that there were fails.
Then
image([min(X),max(X)], [min(Y),max(Y)], prediction, 'Alpha', ADmask);
Now whatever is "under" the image will show through. (If you do not specifically put something black there, then your grey axes color is what is likely to show up.)
6 Kommentare
Siehe auch
Kategorien
Mehr zu Data Distribution Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!