change marker size in a pzmap??

20 次查看(过去 30 天)
Robert
Robert 2016-10-2
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 中查找有关 Stability Analysis 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by