Change marker colour of pzplot
Hello everyone
I’m trying to change the marker color in the pzplot graph. I’m using version 2024b.
Apparently, in this version, a new object(?) called "PZPlot Properties" was introduced, which is great.
Using this new object, I can easily change the size and line thickness of all markers. But I can also only change the colour of all markers. I’d like to change the colours of the markers for the poles and zeros separately.
I tried using the "findobj" method and found, that the PZPlot apparently consists of two Scatter-Plots called "PZPoleScatter" and "PZZeroScatter", and I tried changing the color of the markers in those Scatter plots, but this does not seem to have an effect on the markers.
When I change the colour of the markers using the PZPlot properties Object, I see the color definition of the markers in both scatter plots change, and I can also see that the colours change if I directly access the properties and change the colour, but the plot isn’t drawn with those correct colors.
I tried using refresh after changing the values, but that doesn’t have any effect either.
See my code below:
s = tf(‘s’);
f = (1 + 1/s)
pzp = pzplot(f);
% See https://ch.mathworks.com/help/ident/ref/controllib.chart.pzplot-properties.html for new PZPlot-properties object
pzp.Responses.MarkerSize = 10;
pzp.Responses.LineWidth = 2;
%pzp.Responses.Color = ‘green’; % Changes colour of all markers
oPole = findobj(gca, ‘Tag’, ‘PZPoleScatter’);
oPole.MarkerEdgeColor = ‘red’;
oZero = findobj(gca, ‘Tag’, ‘PZZeroScatter’);
oZero.MarkerEdgeColor = ‘blue’;
rsp = findobj(gca, ‘Tag’, ‘PZPoleScatter’); % read object again to see if properties got changed correctly
I also found the following two topics, but they do not work anymore as there is no "Line" child in the PZPlot object.
https://ch.mathworks.com/matlabcentral/answers/276605-change-pzplot-marker-size
https://ch.mathworks.com/matlabcentral/answers/431293-i-am-using-pole-zero-map-pzmap-and-i-want-to-enhance-the-size-of-pole-or-zero-or-in-other-words-iHello everyone
I’m trying to change the marker color in the pzplot graph. I’m using version 2024b.
Apparently, in this version, a new object(?) called "PZPlot Properties" was introduced, which is great.
Using this new object, I can easily change the size and line thickness of all markers. But I can also only change the colour of all markers. I’d like to change the colours of the markers for the poles and zeros separately.
I tried using the "findobj" method and found, that the PZPlot apparently consists of two Scatter-Plots called "PZPoleScatter" and "PZZeroScatter", and I tried changing the color of the markers in those Scatter plots, but this does not seem to have an effect on the markers.
When I change the colour of the markers using the PZPlot properties Object, I see the color definition of the markers in both scatter plots change, and I can also see that the colours change if I directly access the properties and change the colour, but the plot isn’t drawn with those correct colors.
I tried using refresh after changing the values, but that doesn’t have any effect either.
See my code below:
s = tf(‘s’);
f = (1 + 1/s)
pzp = pzplot(f);
% See https://ch.mathworks.com/help/ident/ref/controllib.chart.pzplot-properties.html for new PZPlot-properties object
pzp.Responses.MarkerSize = 10;
pzp.Responses.LineWidth = 2;
%pzp.Responses.Color = ‘green’; % Changes colour of all markers
oPole = findobj(gca, ‘Tag’, ‘PZPoleScatter’);
oPole.MarkerEdgeColor = ‘red’;
oZero = findobj(gca, ‘Tag’, ‘PZZeroScatter’);
oZero.MarkerEdgeColor = ‘blue’;
rsp = findobj(gca, ‘Tag’, ‘PZPoleScatter’); % read object again to see if properties got changed correctly
I also found the following two topics, but they do not work anymore as there is no "Line" child in the PZPlot object.
https://ch.mathworks.com/matlabcentral/answers/276605-change-pzplot-marker-size
https://ch.mathworks.com/matlabcentral/answers/431293-i-am-using-pole-zero-map-pzmap-and-i-want-to-enhance-the-size-of-pole-or-zero-or-in-other-words-i Hello everyone
I’m trying to change the marker color in the pzplot graph. I’m using version 2024b.
Apparently, in this version, a new object(?) called "PZPlot Properties" was introduced, which is great.
Using this new object, I can easily change the size and line thickness of all markers. But I can also only change the colour of all markers. I’d like to change the colours of the markers for the poles and zeros separately.
I tried using the "findobj" method and found, that the PZPlot apparently consists of two Scatter-Plots called "PZPoleScatter" and "PZZeroScatter", and I tried changing the color of the markers in those Scatter plots, but this does not seem to have an effect on the markers.
When I change the colour of the markers using the PZPlot properties Object, I see the color definition of the markers in both scatter plots change, and I can also see that the colours change if I directly access the properties and change the colour, but the plot isn’t drawn with those correct colors.
I tried using refresh after changing the values, but that doesn’t have any effect either.
See my code below:
s = tf(‘s’);
f = (1 + 1/s)
pzp = pzplot(f);
% See https://ch.mathworks.com/help/ident/ref/controllib.chart.pzplot-properties.html for new PZPlot-properties object
pzp.Responses.MarkerSize = 10;
pzp.Responses.LineWidth = 2;
%pzp.Responses.Color = ‘green’; % Changes colour of all markers
oPole = findobj(gca, ‘Tag’, ‘PZPoleScatter’);
oPole.MarkerEdgeColor = ‘red’;
oZero = findobj(gca, ‘Tag’, ‘PZZeroScatter’);
oZero.MarkerEdgeColor = ‘blue’;
rsp = findobj(gca, ‘Tag’, ‘PZPoleScatter’); % read object again to see if properties got changed correctly
I also found the following two topics, but they do not work anymore as there is no "Line" child in the PZPlot object.
https://ch.mathworks.com/matlabcentral/answers/276605-change-pzplot-marker-size
https://ch.mathworks.com/matlabcentral/answers/431293-i-am-using-pole-zero-map-pzmap-and-i-want-to-enhance-the-size-of-pole-or-zero-or-in-other-words-i pzplot, marker, customization MATLAB Answers — New Questions