Azzera filtri
Azzera filtri

how do i make the output of axesm fill more of a figure window?

1 visualizzazione (ultimi 30 giorni)
I have a high aspect ratio axesm() setup that plots the world from -60 to 60 degrees in latitude. The figure it loads into is also high aspect ratio, but the axesm() output generated is much smaller than the figure. When I zoom (which we'll be doing all the time), the displayed data is clipped to the smaller original axesm window. This wastes a whole lot of screen real estate. I don't see any Position() controls for axesm(). Help?
  1 Commento
dpb
dpb il 2 Gen 2015
Don't have the mapping toolbox so can't 'spearmint here, but reading the doc for axesm indicates it's just a higher-level object wrapping a standard axes. Ergo, use get, set on the actual axes and figure properties to adjust those that aren't specific to the mapping properties themselves. Probably will take some trial and error to figure out what want where, but the position properties are associated with those underlying objects.

Accedi per commentare.

Risposta accettata

dpb
dpb il 4 Gen 2015
Modificato: dpb il 5 Gen 2015
You're misinterpreting what the doc is saying...it doesn't say the axesm function object includes all the possible named properties of an axes object as inputs that can be passed on or modified/retrieved but that it is a higher-level abstraction of an axes with a specific set of properties as enumerated in the documentation. If they're not enumerated there, you can't get to them via axesm.
To get to the 'position' property you have to retrieve the handle of the actual underlying axes object and use set/get on it.
So, something like
hMap=axesm(...); % create the map axes object
hAx=gca; % retrieve the handle of the axes itself
pAx=get(hAx,'position'); % and the position vector
Now, from here modify pAx as desired and then set it
set(hAx,'position',pAxMungedUponToHeartsContent);
Same idea for any other axes property not reflected in the map object.
Now, why TMW didn't include the underlying axes handle as either a property or an optional return value you'll have to ask them; seems like a logical thing to have done. I suppose they didn't think there'd be much demand for anything except the defaults. Would seem to be a logical extension request.

Più risposte (2)

Chad Greene
Chad Greene il 4 Gen 2015
Not sure if this is what you're looking for, but the axis tight command works with maps.

Mike Wilson
Mike Wilson il 4 Gen 2015
Thanks for the comment. I saw the reference (claim) in docs that axesm() is just an extension to the axes() function so all the same arguments apply. That does not appear to be the case. get() and set() do work, but position() does not. I know there's a way. Like you say - gonna take some trial and error.

Categorie

Scopri di più su Graphics Object Programming in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by