To make the table fit your landscape, put this in your preamble:
\usepackage{geometry}
\usepackage{pdflscape}
And for your landscape page, do this:
\newgeometry{margin=1cm} % modify this if you need even more space
\begin{landscape}
%put your table here
\end{landscape}
\restoregeometry
If you are working in a document that makes use of fancyhdr
, you might want to put \thispagestyle{empty}
on your landscape page so that you can make use of the space normally occupied by the header/footer. (and it looks cleaner in my opinion)
Ah well - I guess this is the answer, pg 487 of the pgfmanual.pdf:
Rotations and scaling. The matrix node is never rotated or shifted, because the current coordinate
transformation matrix is reset (except for the translational part) at the beginning of \pgfmatrix. This
is intentional and will not change in the future. If you need to rotate the matrix, you must install an
appropriate canvas transformation yourself.
However, nodes and stuff inside the cell pictures can be rotated and scaled normally.
... Also, from matrix nodes with sloped option? - pgf-users:
It does say in the manual that it isn't possible (in section 16.2
"Matrices are Nodes"), and that the transformation matrix is reset at
the beginning of a matrix. The (internal) use of \halign
precludes any
kind of fancy transformations. It would be pretty hard to do matrices
without using \halign
.
... HOWEVER ...
... matrix nodes with sloped option? - pgf-users also says:
Indeed.
However, you can do the following: Put the whole node inside a
tikzpicture
, which in turn you put in a node that has the sloped
option. Something like
... (A) -- (B) node[midway,sloped] {\tikz \matrix ...;};
which means that the code above can be modified like this:
\begin{tikzpicture}[font=\tt]
\matrix (xA) [anchor=west,text ragged]
{%
\node(xA1) [draw,right,minimum width=5em] {horizon1} ; \\
\node(xA2) [draw,right] {horiz2} ; \\
% \node(xA3) [draw,anchor=west,minimum width=5em] {\begin{minipage}{5em}hor3\end{minipage}} ; \\
\node(xA3) [draw,anchor=west,minimum width=5em] {\parbox{5em}{hor3}} ; \\
};
\matrix (yA) [below left=of xA]
{%
\node(yA1) [draw,right,rotate=270] {vert1} ; &
\node(yA2) [draw,right,rotate=270] {vert2} ; &
\node(yA3) [draw,right,rotate=270] {vert3} ; \\
};
\node (zzA) [rotate=270,below left=of yA] {
\tikz \matrix (zA)
{%
\node(zA1) [draw,right] {horvert1} ; \\
\node(zA2) [draw,right] {horvert2} ; \\
\node(zA3) [draw,right] {horvert3} ; \\
};
};
\end{tikzpicture}
... which will finally result with the originally desired image:
Best Answer
Right-click on "Float: Table", click on "Settings", and check "Rotate sideways".
To insert custom LaTeX code in LyX (where you mention
\begin{landscape}
), go to Insert > TeX Code (ctrl + L on Ubuntu). This is referred to as "ERT".