How to plot inset in a subplot defined by axesand position?

8 visualizaciones (últimos 30 días)
shahab ullah khan
shahab ullah khan el 24 de Feb. de 2022
Comentada: KSSV el 24 de Feb. de 2022
I want to insert inset into a subplot defined by position command, but it gives me error. Here is the code i wrote , so just the inset appears and not the subplot.
figure('position',[100 100 800 900])
subplot('position',[100 100 800 300])
x=linspace(1,10);
y=linspace(1,10);
plot(x,y)
h=axes('Parent', gcf, 'Position',[.6 .85 .3 .07])
h =
Axes with properties: XLim: [0 1] YLim: [0 1] XScale: 'linear' YScale: 'linear' GridLineStyle: '-' Position: [0.6000 0.8500 0.3000 0.0700] Units: 'normalized' Show all properties
plot(h,x,y,'b-','linewidth',1.5)

Respuestas (1)

KSSV
KSSV el 24 de Feb. de 2022
figure('position',[100 100 800 900])
% subplot('position',[100 100 800 300])
x=linspace(1,10);
y=linspace(1,10);
plot(x,y)
h=axes('Parent', gcf, 'Position',[.6 .85 .3 .07])
h =
Axes with properties: XLim: [0 1] YLim: [0 1] XScale: 'linear' YScale: 'linear' GridLineStyle: '-' Position: [0.6000 0.8500 0.3000 0.0700] Units: 'normalized' Show all properties
plot(h,x,y,'b-','linewidth',1.5)
  2 comentarios
shahab ullah khan
shahab ullah khan el 24 de Feb. de 2022
Thank you @KSSV. But i need subplots in the figure window i defined, and need insets inside the subplots.
KSSV
KSSV el 24 de Feb. de 2022
You have nit used the subplot command properly. Read about it.

Iniciar sesión para comentar.

Categorías

Más información sobre Data Type Conversion en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by