I'm trying to do a plot with facets with some data from a previous model. As a simple example:
t=1:10;
x1=t^2;
x2=sqrt(t);
y1=sin(t);
y2=cos(t);
How can I plot this data in a 2x2 grid, being the rows one factor (levels x
and y
, plotted with different colors) and the columns another factor (levels 1
and 2
, plotted with different linetypes)?
Note: t
is the common variable for the X axis of all subplots.