필터 지우기
필터 지우기

I can't get smithplot to work with tiledlayout

조회 수: 11 (최근 30일)
Chase Griswold
Chase Griswold 2024년 3월 16일
댓글: Chase Griswold 2024년 3월 29일
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
Chase Griswold
Chase Griswold 2024년 3월 16일
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');

댓글을 달려면 로그인하십시오.

답변 (1개)

Kausthub
Kausthub 2024년 3월 27일
편집: Kausthub 2024년 3월 27일
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
Chase Griswold
Chase Griswold 2024년 3월 29일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Visualization and Data Export에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by