![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/893165/image.png)
How to make the zplane function to plot on a existing axes?
22 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
The zplane function always create a new plot. HOW to let it on a exisiting axes? Or any workaround?
0 comentarios
Respuesta aceptada
Paul
el 13 de Feb. de 2022
Editada: Paul
el 13 de Feb. de 2022
You can specify an existing axis via a third argument. I didn't see this on the doc page, but it does show up in the help,
help zplane
The following code works fine on my local installation. It results in a figure with three lines and the zplane pole/zero plot..Don't know why it's not working here?
figure;
rng(101);
plot(rand(3));
hax = gca;
zplane([1 2 3],[3 2 1],hax)
Here is the figure I get on my machine:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/893165/image.png)
2 comentarios
Paul
el 14 de Feb. de 2022
There should be link or something similar at the bottom of the doc page that allows you to provide feedback on a doc page if you wish.
Más respuestas (1)
Voss
el 13 de Feb. de 2022
Editada: Voss
el 13 de Feb. de 2022
I don't think you can do that with zplane(), but you can, in your own axes, fairly easily reproduce the lines that zplane() creates:
% First a zplane plot for reference:
[b,a] = ellip(4,3,30,200/500);
zplane(b,a);
% Now a new figure and axes with some stuff in it:
figure();
plot(linspace(-1,1,10),linspace(-1,1,10),'rs','LineWidth',2);
hold on
% Now, plotting what zplane(b,a) would plot:
axis equal
z = roots(b);
p = roots(a);
t = linspace(0,2*pi,1000);
blue = [0 0.447 0.741];
xl = get(gca(),'XLim');
yl = get(gca(),'YLim');
line(xl,[0 0],'Color',blue,'LineStyle',':','LineWidth',0.5);
line([0 0],yl,'Color',blue,'LineStyle',':','LineWidth',0.5);
line(cos(t),sin(t),'Color',blue,'LineStyle',':','LineWidth',0.5);
line(real(z),imag(z),'Color',blue,'LineStyle','none','Marker','o','MarkerSize',7);
line(real(p),imag(p),'Color',blue,'LineStyle','none','Marker','x','MarkerSize',8);
xlabel('Real Part');
ylabel('Imaginary Part');
Ver también
Categorías
Más información sobre Filter Analysis en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!