I'm in agreement with Toby. None of the functions on MATLAB central that address the spacing issue seem to handle spanning multiple columns/rows (tight_subplot.m,subplotSpacing.m or subaxis). The search continues.
I second what Dan said. Spanning multiple columns/rows would be really useful. For example:
ha = tight_subplot(2,2,0.1,0.1,0.1)
This doesn't work if you combine subplots - line 18 in the code catches it as an error. For example:
Error using subplotSpacing (line 18)
dimensions of subplot do not match number of elements of h
18 Mar 2012
KEEP is complementary to the "clear" command: it keeps the supplied variables and deletes the rest.
Author: David Yang
A useful edit would be to check for the workspace for the variables and error out if not found. Otherwise if you mistype, you lose the variable you want to keep.
I am curious if the save_figure() feature, to enable saving and reloading to a .fig file was ever implemented, as noted in your 7/14/2014 update. I don't see the functionality in the current version of the code, and this would be very useful to me if it worked smoothly. (I get the same errors as Alex when trying to reload a saved .fig).
Great tool though!!
I'm sorry if I seem to be harping, but it looks like the set_padding method is not operational either. I don't find any reference to the loose_inset property in the reposition_content function. Is this something that you've worked on?
For my first item below, it can be eliminated by changing the code in the set_zoom_button_position as follows:
%DWK: Inlining the layering command provides modest speed improvement
parentObj = get(this.subplotzoom_data(ir,ic).zm_btn,'Parent');
allDescendents = get(parentObj,'Children');
% Only changing the layering if necessary makes a big difference
zmBtnIndex = find(allDescendents == this.subplotzoom_data(ir,ic).zm_btn,1);
thisAXIndex = find(allDescendents == this.hax(ir,ic),1);
if zmBtnIndex < thisAXIndex,
newOrder = [allDescendents(allDescendents~=this.subplotzoom_data(ir,ic).zm_btn);this.subplotzoom_data(ir,ic).zm_btn];
On the other hand, I've found a new issue. The use of the colorbar method doesn't seem to be working. Every time I try to use it I get the following error:
Error using colorbar (line 55)
Attempt to reference field of non-structure array.
Error in subplot_grid/colorbar (line 2181)
hcb = colorbar('peer',this.hax(ir,ic),location);
Just wanting to touch base here, in that I think it could use a bit of work to be more R2014b compatible. The issues that I'm seeing are:
1. A lot of warnings...
Warning: Illegal permutation. No effect on view
> In subplot_grid>subplot_grid.set_zoom_button_position at 2780
In subplot_grid>subplot_grid.reposition_content at 2620
In subplot_grid>subplot_grid.subplot_grid at 680
2. The appearance of a background axis object behind the grid.
Unfortunately I don't have the time to try tracking it down now, but I thought I would mention it.
As always, many thanks.
Thank you for the feedback and nice rating.
It's funny to notice that the
thing you like about the way matlab creates legends is exactly why I dislike it.
I agree that when you change the color of a graph, the default legend will change automatically and this can surely be handy. However to me this often spells trouble and was the reason to do it differently. I therefore opted for a legend that is NOT directly coupled to the data.
I'll try to seewhat I can do,however,I seriously doubt I can do a lot since the default legend is not linked to a specific axes via a property or something.
But I'll give it a go.
Please check the updates or my comments in case it is not possible or practically feasible.