0

This question already has an answer here:

How do you make the content of this cell algin vertically centered? Notes

Here is the current output based on the code below. Thanks

\documentclass[]{article}
\usepackage[margin=0.5in]{geometry}
\usepackage{pgfplots}
\renewcommand{\thesection}{\arabic{section}}
\usepackage{mathtools}
\usepackage{cancel}
\usepackage{pgfplots}
\usepackage{amsmath}
\newtheorem{theorem}{THEOREM}
\newtheorem{proof}{PROOF}
\usepackage{tikz}
\usetikzlibrary{arrows,positioning,shapes,fit,calc}
\usepackage{amssymb}
\usetikzlibrary{patterns}
\usepackage{fancyhdr}
\usepackage{bigints}
\usepackage{color}
\usepackage{tcolorbox}
\usepackage{color,xcolor }
\usepackage{booktabs,array}
\usepackage{hyperref}
\usepackage{graphicx}
\usetikzlibrary{arrows}
\usepackage{polynom}
\DeclareMathOperator{\rank}{rank}
\makeatletter
\newenvironment{sqcases}{%
    \matrix@check\sqcases\env@sqcases
}{%
\endarray\right.%
}
\def\env@sqcases{%
    \let\@ifnextchar\new@ifnextchar
    \left\lbrack
    \def\arraystretch{1.2}%
    \array{@{}l@{\quad}l@{}}%
}
\begin{document}
The graph of the quadratic function $y=ax^2$
\begin{center}
\setlength\arraycolsep{6pt} % default is "5pt"
$\begin{array}{>{\centering\arraybackslash}m{1in}cc}
\midrule
\text{ } &
a>0 &
a<0\\
\midrule
\text{graph} &
\pgfplotsset{every axis/.append style={
axis x line=middle,    % put the x axis in the middle
axis y line=middle,    % put the y axis in the middle
axis line style={<->}, % arrows on the axis
title={$y$},
xlabel={$x$},          % default put x on x-axis
ylabel={},          % default put y on y-axis
ticks=none
}}
\begin{tikzpicture}
\begin{axis}[
xmin=-1.3,xmax=1.3,ymin=-0.5,ymax=1.5
]
\addplot[thick,samples=20,domain=-1:1] {x^2};
\end{axis}
\end{tikzpicture} &
\pgfplotsset{every axis/.append style={
axis x line=middle,    % put the x axis in the middle
axis y line=middle,    % put the y axis in the middle
axis line style={<->}, % arrows on the axis
title={$y$},
xlabel={$x$},          % default put x on x-axis
ylabel={},          % default put y on y-axis
ticks=none
}}
\begin{tikzpicture}
\begin{axis}[
xmin=-1.3,xmax=1.3,ymin=-1.5,ymax=0.5
]
\addplot[thick,samples=20,domain=-1:1] {-x^2};
\end{axis}
\end{tikzpicture}
\\
\midrule
\text{behaviour} &
\text{increasing for } x>0, \text{decreasing for }x<0 &
\text{decreasing for } x>0, \text{increasing for }x<0
\\\\
\midrule
\text{vertext} &
\multicolumn{2}{c}{(0,0)}\\
\\
\midrule
\text{size} &
\multicolumn{2}{c}{\text{If the value of }|a|\quad
\begin{sqcases}
\text{increases, the wider the shape of the parabola}\\
\text{decreases, the narrower the shape of the parabola}\\
\end{sqcases}}\\
\midrule
\end{array}$
\newline\newline
\end{center}
\end{document}

marked as duplicate by Mensch, Bobyandbob, Stefan Pinnow, Mico tables Dec 10 '17 at 1:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

It is perfectly centred. The only reason for what you get is two empty rows. I've commented out the spurious \\ in the relevant part of your code (lines 82-91).

\midrule
\text{behaviour} &
\text{increasing for } x>0, \text{decreasing for }x<0 &
\text{decreasing for } x>0, \text{increasing for }x<0
\\%\\
\midrule
\text{vertext} &
\multicolumn{2}{c}{(0,0)}%\\
\\
\midrule

Additionnally, wrapping the tikzpicture environments in a \raisebox-0.5\height{…}, you can centre thegraphtext. Example for the firsttikzpicture` (lines 58-64):

\raisebox{-0.5\height}{\begin{tikzpicture}
\begin{axis}[
xmin=-1.3,xmax=1.3,ymin=-0.5,ymax=1.5
]
\addplot[thick,samples=20,domain=-1:1] {x^2};
\end{axis}
\end{tikzpicture}} &

enter image description here

  • What about "graph" text? It is sitting at the bottom for some reason – Will Kim Feb 13 '16 at 2:50
  • For the reason the bottom of the graphs lies on the base line of tthe row. Where do you want the text to be? At the top? – Bernard Feb 13 '16 at 3:00
  • I would like to vertically center the word "graph". – Will Kim Feb 13 '16 at 3:06
  • It's done with a couple of \raiseboxes. Please see my updated answer. – Bernard Feb 13 '16 at 3:10
  • Not sure what you mean but thank you for your help Bernard :) – Will Kim Feb 13 '16 at 8:39

Not the answer you're looking for? Browse other questions tagged or ask your own question.