nschloe/matlab2tikz — pull request #466 by PeterPablo (2014-11-25 11:32:05+00:00)
Title: fix issue in findLegendInformation with `addaxes`

consider this example:
```
data = magic(3); h(1) = plot(data(1,:),'r-'); hold on; h(2) = plot(data(2,:),'k--'); legend('plot1','plot2'); % add additional x-axis with nonlinear scaling xFun = @(x) x.^2; addaxes('XFun',xFun);
```

m2t has an issue in function `findLegendInformation` when adding an additional x-axis with nonlinear scaling using the FileExchange contribution `addaxes` (http://www.mathworks.com/matlabcentral/fileexchange/24875-addaxes-m-v1-1--sep-2009-).

For some reason `child` might be empty. This would cause an error during the comparison with `plotChildren`. The issue is circumvented by checking for empty children.
--> `if ~isempty(child)` with accompanying `end` is the only change.

R2014b:
![image](https://cloud.githubusercontent.com/assets/4340267/5182180/c359a9ae-749e-11e4-8965-6fe8ca010ef5.png)