How to plot different graph in one figure?

% Mullar Matrix analysis
clc
clear all
% [x,y]=meshgrid(-1:0.1:1,-1:0.1:1)
% y=1
% x=2
for x=-1:0.1:1
Y=c*Ey.*sind(t);
% M=[Z(1,1), Z(2,1), Z(3,1), Z(4,1)];
% G=stokes(fv)
% stokes(M)
figure(1)
plot(X,Y,'-',LineWidth=2),xlabel('2Ex'),ylabel('2Ey'),title('Polarization Ellipse') %,LineWidth=2)
hold on
end
end
This is my Code for polarization state of light, where I am doing a simulation of polarization rotation using Mueller matrix method.
  1. My input is in terms of position coordinates which varies from x=-1:1 and y=-1:1
  2. I can vary x and keep y constant, and can do same for y keeping x constant, This way I got polarization state from Hz. and Vr. scan.
  3. My device has dimention 2*2cm^2 where if I place this device on coordinate system -1 distance from left +1 for right and bottom and top respectively.
  4. I can plot any graph for a particular position by giving input.
  5. when I try for loop all the states are plotted at same position, I need to plot them at different spatial position (exactly at same input which I enter).
  6. I want what coordinate I give input, my polarization state to be plotted at that input. Different position have different stokes parameters , So different position (my input) of device have different state of polarization which I want to plot.
  7. Kindly help, how can I plot all the stokes parameter of my input in one figure. Code is attached above.

5 Comments

Which variable in your code do you want to plot agianst which variable(s) ? Use the variable names instead of polarization, position, stokes parameters or something similar.
I want to plot (X,Y) in a square window (2*2, where lengh vary from -1 to 1 ) where (x,y) is input and my output should be plotted at the input coordinate (x,y) position, not like all the lines are plotted at same position.
These different graph should be plotted in same window but without overlapping each other. Like as shown in picture bolow.
Torsten
Torsten on 2 Jan 2023
Edited: Torsten on 2 Jan 2023
And where do you compute the vector field you want to attach at coordinate (x/y) ? Is it X and Y ? Then why for each pair (x/y), you generate X and Y both as 1x361 arrays because of t = -180:180 ? X and Y should be scalars for each pair (x/y).
actually all the figure that I am generation by plotting (X,Y), I want to plot them in such away that they are spatially seperated in such a way that I have different location for (x,y). I have different plot for each (x,y) & I want to plot them seperately in one figure. I don't know vector field plotting currently.
I can do also like
y=-0.1
x=-1:0.2:1
and plots will be generated for a line scan of x from -1 to 1 at step of 0.2
So I want to plot all these graphs on a line where plot(X,Y) give me output, at coordinate input (x,y) position. like as shown below, 1 2 3 marked, so is there any method for plotting of these various graphs so that I can make spatial variation in tem like subplotting etc. .
Torsten
Torsten on 2 Jan 2023
Edited: Torsten on 2 Jan 2023
Sorry, you lost me here.
For a vector field plot like in a), b), c) and d), you can use "quiver".

Sign in to comment.

Answers (1)

You can try to use polar plot with polar(), e.g.:
...
figure(1)
polar(X,Y)
xlabel('2Ex'),ylabel('2Ey'),title('Polarization Ellipse')
hold all
...

Categories

Asked:

on 2 Jan 2023

Edited:

on 19 Feb 2023

Community Treasure Hunt

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

Start Hunting!