A subplot figure with a lot of fancy features
1,8K descargas
Actualizado 12 ene 2015

Ver licencia

SUBPLOT_GRID is a class with which a set of subplots can be created in a space-optimal way. In addition, a figure title and subtitle may be added, as well as specific row and column titles.
Even after resizing, the texts ((sub)figure title and row and column titles) are NOT scaled, keeping the maximum space for the axes.
The SUBPLOTZOOM (combined with maybe ZOOMLINK_AXES) function enables filling the figure window with one or more axes.
The INTERAXES function provides the possibility to show the clicked on data point in an axes, and to shows its values in the title.
The methods LEGEND and COLORBAR ensure a correct handling on zooming and resizing.
Saving the figure to a .fig file, and reloading it via 'openfig' will give a working and fully functionning subplot_grid again. To enable access to the properties and functions/methods, an object called 'o_subplot_grid' is created in the workspace. Within this object all wanted properties and methods can be called.
Available methods (listed alphabetically):

COLORBAR - creates a colorbar to an axes
COLTITLES - Adds column titles (top and bottom are possible, locations can be manually set)
FIGTITLE - Adds a figure title
SUBFIGTITLE - Adds a subtitle
DISABLE_INTERAXES - remove clickable content
DISABLE_SUBPLOTZOOM - remove zoom action
ENABLE_INTERAXES - Enable clickable content
ENABLE_SUBPLOTZOOM - Enable figure filling zoom
EXTRACT_AXES- extract an axes to a new figure
FIGPLACE - grid the figure window or maximize the window
FIGTITLE - add a global figure title
HIDE_AXES - make some axes invisible
HIDE_EMPTY_AXES - hide all empty axes
LEGEND - add a pre-defined legend
OVERWRITE_INTERAXES_SELECTION_MODS - some user-defined modifications for clickable content (interaxes)
REDRAW - redraw the figure (re-align all)
REMOVE_LEGEND - remove legend
ROWTITLES- add texts on the left/right around the axes. Location can be manually set
SET_GCA - set axes to current axes in matlab
SET_PADDING - reset padding around axes
SHOW_AXES - show hidden axes
SUBFIGTITLE - a subtitle
SYNC_AXES - sync x, y or color axes
ZOOMLINK_AXES - link axes on use of subplotzoom.

run 'subplot_grid' for a demo.

The syntax of every method can be found by 'help subplot_grid.<method>'

Citar como

Joris Kampman (2024). subplot_grid (, MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2014b
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux

Inspiración para: subtightplot

Community Treasure Hunt

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

Start Hunting!
Versión Publicado Notas de la versión

This version is suitable for R2014b, without any guarantee or expected performance for lower matlab releases (i.e., it is checked for hgVersion 2, and hgVersion 1 is not supported!).

Saving the figure is now possible, and the colorbar is upgraded

fixed minor irritation. Now, after construction of a subplot_grid object, the current axes is set to the first subplot, instead of being left undefined

1. possibility to save a .fig file and load without errors
2. very flexible row and column titles on all 4 sides.
3. different resizing scheme (more robust)
4. minor bugfixes

very stupid bug fixed (seen when only plotting a single axes (subplot_grid(1) crashed)

see 'help subplot_grid'

-speed improvement (thanks to Dan Kominsky)
-added method COLORBAR
-added possibility to link axes on zooming in

1: Matched the legend style to MATLAB
2: Bugfix in the legend placement
3: Added correct handling of axes deletion.
4: Added COLORBAR method.
5: Added SET_PADDING which allows control over the amount of whitespace between axes

some bugfixes on legend placements, and the correct working with zooming in and out.