Is it possible to plot all combinations of parameters automatically?

Hi folks,
I am using regionprops to generate all the parameters to do with a binary mask.
Is there an automated way to generate plots of each of the combinations of these parameters? Such as area with orientation, circularity etc...
I've tried to do this manually but am worried I might have missed a combination!

5 Comments

You can run a loop, use hold on and plot.
@KSSV thanks for replying! I've currently tried to do this by testing the following:
i = 1;
j = 1;
plot(myData{i}, myData{j});
xlabel(myIDData{i});
ylabel(myIDData{j});
where myData will be looped through via i and j iterators in future once the concept has been proven. Do you know how to avoid plotting i = j? This was one of the issues I found in the combinatorial approach.
Also, unrelated question, calling myIDData inside xlabel and ylabel appears to not be working, may I ask if there is something I can do to ammend this?
It is as follows:
myIDData = {AreaID, MaxALID, MinALID, EccenID, OrienID, CircID, EqDiamID, SolID, ExtentID, ...
newPerimID, oldPerimID, minFeretDiamID, maxFeretDiamID, minFeretAngleID, maxFeretAngleID};
AreaID = 'Area';
MaxALID = 'Major Axis Length';
MinALID = 'Minor Axis Length';
EccenID = 'Eccentricity';
OrienID = 'Orientation';
CircID = 'Circularity';
EqDiamID = 'Equiv. Diameter';
SolID = 'Solidity';
ExtentID = 'Extent';
newPerimID = 'New Perimeter';
oldPerimID = 'Old Perimeter';
minFeretDiamID = 'Min Feret Diameter';
maxFeretDiamID = 'Max Feret Diameter';
minFeretAngleID = 'Min Feret Angle';
maxFeretAngleID = 'Max Feret Angle';
figure
hold on
for i = 1:m
for j = 1:n
if i~=j
plot(myData{i}, myData{j});
end
end
end
end
@KSSV thanks! I've tried the following but get the error below due to the use of legend. May I please ask what I'm doing wrong?
Also, the reason I wanted to initially plot each graph seperately and not on the same plot was because of the scale of each graph being different. Is there a way to automatically scale them or plot them on a yy-axis based on their scale?
Thanks
figure
hold on
for i = 1
for j = 1:15
if i~=j
plot(myData{i}, myData{j});
xlabel(myIDData{i});
legend(myIDData{j});
end
end
end
hold off
myData = {myArea, MaxAL, MinAL, Eccen, Orien, Circ, EqDiam, Sol, Extent, newPerim, oldPerim, ...
minFeretDiam, maxFeretDiam, minFeretAngle, maxFeretAngle};
myIDData = {AreaID, MaxALID, MinALID, EccenID, OrienID, CircID, EqDiamID, SolID, ExtentID, ...
newPerimID, oldPerimID, minFeretDiamID, maxFeretDiamID, minFeretAngleID, maxFeretAngleID};
AreaID = 'Area';
MaxALID = 'Major Axis Length';
MinALID = 'Minor Axis Length';
EccenID = 'Eccentricity';
OrienID = 'Orientation';
CircID = 'Circularity';
EqDiamID = 'Equiv. Diameter';
SolID = 'Solidity';
ExtentID = 'Extent';
newPerimID = 'New Perimeter';
oldPerimID = 'Old Perimeter';
minFeretDiamID = 'Min Feret Diameter';
maxFeretDiamID = 'Max Feret Diameter';
minFeretAngleID = 'Min Feret Angle';
maxFeretAngleID = 'Max Feret Angle';
I've tried the following but get the error below
I don't see where you've included the error.
Also, the reason I wanted to initially plot each graph seperately and not on the same plot was because of the scale of each graph being different
If you don't want them on the same plot, omit 'hold on'.

Sign in to comment.

Answers (0)

Categories

Products

Release

R2022b

Asked:

on 20 Sep 2022

Commented:

on 20 Sep 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!