Tiled layout with a nested graph spanning multiple tiles

13 visualizaciones (últimos 30 días)
James
James el 31 de En. de 2025
Comentada: James el 31 de En. de 2025
I would like to nest/superimpose a plot on another, which is part of a tiledlayout and spans multiple tiles. The following works fine:
figure
tiledlayout(1, 6)
nexttile([1 5])
plot(1:10)
nexttile(6)
plot(11:20)
However, the following does not and it results in two figures:
figure
tiledlayout(1, 6)
nexttile([1 5])
plot(1:10)
axes("position", [0.5 0.5 0.2 0.2])
plot(21:30)
nexttile(6)
plot(11:20)

Respuesta aceptada

Cris LaPierre
Cris LaPierre el 31 de En. de 2025
Perhaps it's your 'order of operations'. What if you add the floating axes last?
figure
tiledlayout(1, 6)
nexttile([1 5])
plot(1:10)
nexttile(6)
plot(11:20)
axes("position", [0.5 0.5 0.2 0.2])
plot(21:30)
  2 comentarios
Adam Danz
Adam Danz el 31 de En. de 2025
Pro tip 😎 nexttile('east')
figure
tiledlayout(1, 1)
nexttile()
plot(1:10)
nexttile('east')
plot(11:20)
axes("position", [0.5 0.5 0.2 0.2])
plot(21:30)
James
James el 31 de En. de 2025
Great, thanks! I like the simplification with "east" too.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Productos


Versión

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by