0

I have tried many ways to align the table and figure on the same row but nothing worked for me. Here is my current code:

\documentclass[a4paper, 12pt]{article}
\usepackage[a4paper, margin=2cm]{geometry}
\usepackage{booktabs}
\usepackage{pgfplots}

\begin{document}

\begin{table}[ht]
\renewcommand\arraystretch{1.5}
\caption{values of theoretical and measured capacitor voltages for different frequency values.}
\center
\begin{tabular}{p{0.10\textwidth} p{0.10\textwidth}}
\toprule
Resistance R ($\Omega$) & Capacitor Voltage $V_{c}$ (V)  \\ 
\midrule
1000 & 10.0 \\
2000 & 9.92 \\
3000 & 9.28 \\
4000 & 8.40 \\
5000 & 7.52 \\
10000 & 4.56 \\
20000 & 2.48 \\
\bottomrule
\end{tabular}
\end{table}

\begin{figure}[h!]
\centering
\begin{tikzpicture}
\begin{minipage}[b]{0.45\linewidth}\centering

\end{minipage}
\begin{axis}[
    xlabel={R (Hz)},
    ylabel= $V_c (V)$,
    legend pos=south east,
    legend entries={R,V},
    ]
  \addplot table [x=R,y=V] {Resistance_vs_Voltage.txt};
\end{axis}
\end{tikzpicture}
\end{figure}

\end{document}

The output looks like this:

enter image description here

The output that I want is:

enter image description here

I am also sorry if my code is hard to read as it's my first time using LaTeX.

2

0

Browse other questions tagged .