Azzera filtri
Azzera filtri

MATLAB : resize figure, axis does not move

2 visualizzazioni (ultimi 30 giorni)
Sarah Guiffray
Sarah Guiffray il 15 Lug 2015
Commentato: Brendan Hamm il 15 Lug 2015
Hello,
I have a figure with 2 x-axis. But when I resize the figure, the second axis (on the top) does not move.
I declare the second axis like this :
ax2 = axes('Position',get(ax1,'Position'),... 'XAxisLocation','top',... 'YAxisLocation','right',... 'Color','none',... 'XColor','k','YColor','none');
set(ax2, 'XLim', get(ax1, 'XLim'),'YLim', get(ax1, 'YLim'));
set(ax2, 'XTick', get(ax1, 'XTick'), 'YTick', get(ax1, 'YTick'));
set(ax2, 'YTick', []);
How can I resolve this problem ?
  1 Commento
Brendan Hamm
Brendan Hamm il 15 Lug 2015
Can you format the code for your ax2 definition using the '{ } Code' button.
I cannot reproduce your problem, assuming it is the overhang of the second axis which is of issue. Would you mind providing more code for this?

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Interactive Control and Callbacks in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by