Filter löschen
Filter löschen

merge two existing figures with each two y-axis

2 Ansichten (letzte 30 Tage)
Marko
Marko am 24 Dez. 2019
Kommentiert: Walter Roberson am 24 Dez. 2019
Hi guys,
I need two merge to existing figures which each have two different y-axis.
function merge_plots
fh1 = open('pH45_IA70_Nz80_kH0.fig');
fh2 = open('exp_data_pH45_IA70.fig');
L = findobj(fh1,'type','line');
S = findobj(fh2,'type','axes');
copyobj(L,S);
end
fh1 looks like it should. The problem is, that figure fh2 is only plottet in regard to the 'right y-axis'.
Thank you!
Best,
Marko
  2 Kommentare
Walter Roberson
Walter Roberson am 24 Dez. 2019
Figures cannot reliably be merged, as each one can have separate menu bars; it is not possible to have different menu bars for different parts of a single window.
Parts of figures can be copied into parts of other figures, and uipanels can be created that can hold the content from axes if you do not need the match behaviours properly.
Walter Roberson
Walter Roberson am 24 Dez. 2019
When you copyobj() something into place, then automatic resetting of axes limits is not done. You might need to set the object invisible and visible again, or set the target axes XLimMode manual and back to auto, and same for YLimMode .
Or you could examine the axes properties to caculate a bounding box that would include all of the data and change the axes limits to that.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by