I can't get smithplot to work with tiledlayout

2 Ansichten (letzte 30 Tage)
Chase Griswold
Chase Griswold am 16 Mär. 2024
Kommentiert: Chase Griswold am 29 Mär. 2024
I want to do the typical 2x2 tiledlayout for four smith charts with different data.
From what I can gather, matlab has offered tiledlayout support for surf(), contour(), polarscatter(), plot(), etc etc. A lot of stuff, but for some reason they didn't make it work for smith charts. Honestly, I really just don't think it's supported so I'm writing this in the hopes that someone sees it and realizes it would be nice to make it supported. I saw some old stuff someone came up with to make it work with subplot and it's quite deplorable. It makes the smith charts miniscule and in IEEE format (two column) it would be very hard to read. At this point for my publication I'm likely just going to have to take each smith chart, put them in the order I want in Onenote or something, and take a screen capture.
Here is some code you can mess around with (the stuff I'm plotting is way too much to throw in here):
data = nport('default.s2p'); %this default.s2p is likely included in the RF toolbox so I'd make sure you have that.
t = tiledlayout(2,2);
% Tile 1
nexttile
smithplot(data)
% Tile 2
nexttile
smithplot(data)
% Tile 3
nexttile
smithplot(data)
% Tile 4
nexttile
smithplot(data)
It just ends up plotting them like a normal figure; everytime a smithplot is encounterd and appears to completely ignore the nexttile code.
  1 Kommentar
Chase Griswold
Chase Griswold am 16 Mär. 2024
Probably should have mentioned I'm using this style for all of my other data:
figure('Position', [1, 1, 1200, 800])
t = tiledlayout(2,2,'TileSpacing','compact','Padding','compact');

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Kausthub
Kausthub am 27 Mär. 2024
Bearbeitet: Kausthub am 27 Mär. 2024
Hi Chase,
I tried plotting a 2X2 "tiledlayout" for four "smithplots" but was not able to figure it out and I too believe "tiledlayout" is not supported for "smithplots". But here is a workaround using subplots and hopefully meets your expected quality.
data = nport('default.s2p');
figure;
for idx = 1:4
sp = subplot(2, 2, idx);
pos = get(sp, 'Position');
delete(sp);
ax = axes('Position', pos);
smithplot(data, 'Parent', ax);
end
Have attached a figure of the same as well and hope it helps!
  1 Kommentar
Chase Griswold
Chase Griswold am 29 Mär. 2024
I appreciate you playing around with this. Good job. Sadly, this is the same problem I've run into. The padding on the smith charts is absolutely huge! This would be unreadable in a double column publication like IEEE. I have a feeling the reason MATLAB hasn't tried to make this work with Tiledlayout is that it would be a headache to remake the smithplot backend not have that crazy amount of side-padding. That's my guess anyway. Thank you for taking a shot at it! I really do appreciate it even though it won't work for my application.
I also tried combing it with this stuff (tight_subplot(Nh, Nw, gap, marg_h, marg_w) - File Exchange - MATLAB Central (mathworks.com)) to play around with your code a bit more, and still haven't found anything that makes this style of plotting smith charts work.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Axes Appearance finden Sie in Help Center und File Exchange

Produkte


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by