Issue with box plot code or something else?????
Show older comments
I have two sets of mat files. In 1st set, I have 2sn0_sorted, 3sn0_sorted and 4sn0_sorted. In 2nd set, these are 2sn0, 3sn0 and 4sn0. I have the following Matlab code to plot box plot:
clear all
close all
clc
load 2sn0_sorted
fitness2sn0=one;
load 3sn0_sorted
fitness3sn0=one;
load 4sn0_sorted
fitness4sn0=one;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Descending Order
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fitness2sn0=sort(fitness2sn0,'descend');
fitness3sn0=sort(fitness3sn0,'descend');
fitness4sn0=sort(fitness4sn0,'descend');
figure
h1=boxplot([fitness2sn0; fitness3sn0; fitness4sn0].');
set(h1,{'linew'},{2})
grid
Ax = gca;
Ax.XLabel.String = '\bf No. of Sources';
Ax.YLabel.String = '\bf fitness';
Ax.YScale = 'log';
Ax.XTickLabel = compose('%ds',2:4);
Ax.YLim = [1E-30 10];
title('\bf Fitness of different sources with no noise')
set(gca,'linew',2)
When I run the above program and it works well. But when I load my 2nd set of mat files and run the same program, it only displays one plot.
Whats the problem? My mat files are attached herewith.
Accepted Answer
More Answers (0)
Categories
Find more on Data Distribution Plots 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!