change marker size in a pzmap??

31 visualizaciones (últimos 30 días)
Robert
Robert el 2 de Oct. de 2016
Editada: Enrico Fioresi el 17 de Jul. de 2023
How do i change the marker size in a pzmap
set(0,'DefaultLineMarkerSize',12);
this does not effect a pzmap

Respuestas (2)

Star Strider
Star Strider el 2 de Oct. de 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 comentarios
Ismaeel
Ismaeel el 7 de Oct. de 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 el 8 de Oct. de 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.

Iniciar sesión para comentar.


Enrico Fioresi
Enrico Fioresi el 17 de Jul. de 2023
Editada: Enrico Fioresi el 17 de Jul. de 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

Categorías

Más información sobre Graphics Object Properties en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by