change marker size in a pzmap??

49 views (last 30 days)
Robert
Robert on 2 Oct 2016
Edited: Enrico Fioresi on 17 Jul 2023
How do i change the marker size in a pzmap
set(0,'DefaultLineMarkerSize',12);
this does not effect a pzmap

Answers (2)

Star Strider
Star Strider on 2 Oct 2016
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 Comments
Ismaeel
Ismaeel on 7 Oct 2021
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 on 8 Oct 2021
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.

Sign in to comment.


Enrico Fioresi
Enrico Fioresi on 17 Jul 2023
Edited: Enrico Fioresi on 17 Jul 2023
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

Community Treasure Hunt

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

Start Hunting!