# Problem Explicitly Defining a Plot Area

5 vues (au cours des 30 derniers jours)
Allen Hammack le 1 Déc 2021
Commenté : Star Strider le 4 Déc 2021
I am trying to figure out how to explicitly define the area and axes location for a plot. I've looked through this link:
but I haven't had much success, yet. I'm using this code to set my plot area and axis locations:
fig = figure('units','normalized','OuterPosition',[0 0 1 1],'InnerPosition',[0.1 0.1 0.8 0.8],'Position','TightInset');
I want to know the locations of my axes because I'm also going to add annotations for multiple sets of data, and the locations of those annotations will need to be set programmatically.
This code produces the following error:
Error using figure
Value must be numeric and finite
Error in plot_test_model_chamber_wse (line 14)
fig = figure('units','normalized','OuterPosition',[0 0 1 1],'InnerPosition',[0.1 0.1 0.8 0.8],'Position','TightInset');
Can someone please help me fix this error, so I can define my plot area like I need?
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Réponse acceptée

Star Strider le 1 Déc 2021
The problem is the 'Position','TightInset' name-value pair. The 'Position' property value must be a four-element vector. The 'TightInset' property is one of the Axes Properties, not one of the Figure Properties.
fig = figure('Units','normalized','OuterPosition',[0 0 1 1],'InnerPosition',[0.1 0.1 0.8 0.8]);
.
##### 4 commentairesAfficher 2 commentaires plus anciensMasquer 2 commentaires plus anciens
Allen Hammack le 4 Déc 2021
Thank you! With your suggestions, I can iterate to get the plot to look like what I want!
Star Strider le 4 Déc 2021
As always, my pleasure!
.

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Axis Labels dans Help Center et File Exchange

R2021b

### Community Treasure Hunt

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

Start Hunting!

Translated by