Contour plot shrinking about its origin
Mostrar comentarios más antiguos
I have a contour plot. I need to shrink it about its origin. I have tried to shrink it as a polygon but it does not work. Could you please help me to overcome the problem? I want shrinking the contour plot about its origin.
I found the code below, but it is for contour plot rotation.
Note: I use matlab ver. 2008.
Any help will be much appreciated.
a = 37;
[x,y] = meshgrid(linspace(-4,4,30));
z = exp(-x.^2/15-y.^2);
contour(x,y,z)
xlim([-5 5])
ylim([-5 5])
axis equal
figure
[C,h] = contour(x,y,z);
rotate(get(h,'children'),[0 0 1],a)
xlim([-5 5])
ylim([-5 5])
axis equal
Many thanks
Israa
2 comentarios
Ameer Hamza
el 10 de Oct. de 2020
Can you explain what do you mean by shrinking the plot?
israa abdul jabbar
el 10 de Oct. de 2020
Editada: israa abdul jabbar
el 10 de Oct. de 2020
Respuestas (2)
KSSV
el 10 de Oct. de 2020
You change the x,y limits and use the same z...
a = 37;
[x,y] = meshgrid(linspace(-4,4,30));
z = exp(-x.^2/15-y.^2);
figure(1)
contour(x,y,z)
xlim([-5 5])
ylim([-5 5])
axis equal
[x1,y1] = meshgrid(linspace(-1,1,30));
figure(2)
contour(x1,y1,z)
xlim([-1 1])
ylim([-1 1])
axis equal
7 comentarios
israa abdul jabbar
el 10 de Oct. de 2020
KSSV
el 10 de Oct. de 2020
Yes this can be done....read about Afine transformations. In there you have a transformation matrix to reduce the scale of your polygons.
israa abdul jabbar
el 10 de Oct. de 2020
KSSV
el 10 de Oct. de 2020
You have the points in hand...that's enough ..
israa abdul jabbar
el 10 de Oct. de 2020
Star Strider
el 10 de Oct. de 2020
What are these functions:
polygonCentroid
createScaling
transformPoint
and where did you get them?
I can find no references for them either in the MATLAB online documentation or in an Interweb search.
You are doing KSSV a definite disservice by not revealing sources for them or posting the code for them.
israa abdul jabbar
el 10 de Oct. de 2020
israa abdul jabbar
el 10 de Oct. de 2020
0 votos
Categorías
Más información sobre Contour Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!