change marker size in a pzmap??

조회 수: 23 (최근 30일)
Robert
Robert 2016년 10월 2일
편집: Enrico Fioresi 2023년 7월 17일
How do i change the marker size in a pzmap
set(0,'DefaultLineMarkerSize',12);
this does not effect a pzmap

답변 (2개)

Star Strider
Star Strider 2016년 10월 2일
That doesn’t appear to be an option in any of the pole-zero plots:
H = tf([2 5 1],[1 3 5]);
hpz = pzplot(H);
grid on
opz = getoptions(hpz)
  댓글 수: 16
Ismaeel
Ismaeel 2021년 10월 7일
I wish we had something more general so that one can use it for other plots such as Bode, Nichols, Nyquist but apparently there is no such thing.
Walter Roberson
Walter Roberson 2021년 10월 8일
H = tf([2 5 1],[1 3 5]);
bode(H)
fig = gcf;
line_for_magnitude = fig.Children(3).Children(1).Children
line_for_phase = fig.Children(2).Children(1).Children
More generally, take the fig Children and ignore the first of them. The rest are numbered in backwards linear order -- an 2 x 2 array of plots would be
5 3
4 2
Another way of thinking of this is that the plots are drawn down the columns, left to right, just like normal linear ordering for arrays, but as is usual for MATLAB graphics, the most recently drawn object is at the top of the Children list.

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


Enrico Fioresi
Enrico Fioresi 2023년 7월 17일
편집: Enrico Fioresi 2023년 7월 17일
I maybe found another workaround.
ChatGPT aided me, so, I don't know reliable it is. However, it works with rlocus and rlocusplot, so it maybe also works for pzmap.
% Get the handle to the current plot
hAx = gca;
% Set the marker size for poles and zeros
markerSize = 10; % Set the desired marker size
% Get the handles to the poles and zeros markers
hMarkers = findobj(hAx, 'Type', 'line');
% Loop through each marker and set the marker size for poles and zeros
for i = 1:numel(hMarkers)
if any(hMarkers(i).XData) % Check if the marker represents a pole or zero
set(hMarkers(i), 'MarkerSize', markerSize); % change size
end
end
Similarly, the color can be changed.
% Loop through each marker and set the marker size and color for poles and zeros
for i = 1:numel(hMarkers)
if any(hMarkers(i).XData) % Check if the marker represents a pole or zero
set(hMarkers(i), 'MarkerSize', markerSize); % change size
if any(hMarkers(i).YData > 0) % Check if it is a pole marker
set(hMarkers(i), 'MarkerEdgeColor', [0.16 0.73 0.94]); % change color
else
set(hMarkers(i), 'MarkerEdgeColor', [0.78 0.09 0.09]); % change color
end
end
end

카테고리

Help CenterFile Exchange에서 Plot Customization에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by