How to view in-built GA plotting functions side by side?

1 次查看(过去 30 天)
Hi fellow Matlab-ers!
I am using the command line GA from the Global Optimization Toolbox. I am using two plotting functions, @gaplotrange, and @gaplotbestindiv. This plots one on top, and one on the bottom (like subplot(2,1,)), and I would like to set it to be side by side (like subplot(1,2,)).
I have created my own plotting functions by slightly adjusting their code, and I tried to include a subplot inside them, which resulted in only the second called plot function being displayed, though it was displayed correctly (subplot(1,2,2)).
I have also delved into the file 'gadsplot.m' which appeared to be the one responsible for setting up these plots. I tried changing the ordering of the subplots, to no avail. My last ditch attempt was to hard code the subplots as desired, but this hasn't worked either.
So, I was wondering if there is a simple way to do this, or if not, does anyone know which file and what I would have to change to get this to work?
Thanks in advance, Callum.
  2 个评论
Rakesh Kumar
Rakesh Kumar 2015-2-12
You can change the code in gadsplot.m where rows and cols are calculated.
How about a layout (1,2) instead of (2,1)? I can interchange rows and cols in that function.
Callum
Callum 2015-2-13
Thanks, I didn't think about changing that specifically, and it worked! Though I can't seem to accept your answer. Maybe because its a comment and not an answer, though I'm not too sure. In any case I changed lines 114-115 in gadsplot.m to:
%
cols = ceil(sqrt(length(functions)));
rows = ceil(length(functions)/cols);
Cheers, Rakesh!

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Genetic Algorithm 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by