0

I have three horizontal bar-charts that I created using both the Tikz package and PGF plots package in latex. I am using Overleaf. The three horizontal bar-charts look like the following: what the horizontal bar charts currently look like

Is there a way to nest these horizontal bar-charts in a row in a latex document? I need this in order to save space for a paper I am working on. So what I am looking for is this (note: this 2nd image is meant to illustrate what I am looking for exactly): concept of what I want

This is the set up currently:

\documentclass[10pt,journal,compsoc]{IEEEtran}
\usepackage{tabularx,booktabs}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\usepackage{sfmath}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{algorithm, algorithmic}
\usepackage{makeidx}
\usepackage{soul}
\usepackage{color}
\usepackage{colortbl}
\usepackage{xcolor}
\usepackage{tikz}
\usepackage{amsthm,amssymb,amsmath}

\begin{document}

\pgfplotsset{width=5cm,compat=1.15}
\begin{center}
\begin{figure}[h]
\begin{tikzpicture}
  \begin{axis}[title  = \textbf{2016 Data-set Results: Parameters for a Successful game},
    xbar,
    y axis line style = { opacity = 0 },
    axis x line       = none,
    tickwidth         = 0pt,
    ytick             = data,
    enlarge y limits  = 0.05,
    enlarge x limits  = 0.02,
    width=0.3\textwidth,
    bar width=2mm,
    symbolic y coords = {User Count, Critic Count, Critic Score, User Score, Platform, Genre, Rating},
    nodes near coords,
  ]
  \addplot coordinates { (100,User Count) (93,Critic Count) (57,Critic Score) (20,User Score) (10.5,Platform) (2.3,Genre) (4.52,Rating) };
  \end{axis}
\end{tikzpicture}
\caption{Results for the 2016 Dataset on what parameters make a successful game.}
\end{figure}
\end{center}

\pgfplotsset{width=5cm,compat=1.15}
\begin{center}
\begin{figure}[h]
\begin{tikzpicture}
  \begin{axis}[title  = \textbf{2017 Data-set Results: Parameters for a Successful game},
    xbar,
    y axis line style = { opacity = 0 },
    axis x line       = none,
    tickwidth         = 0pt,
    ytick             = data,
    enlarge y limits  = 0.05,
    enlarge x limits  = 0.02,
    width=0.3\textwidth,
    bar width=2mm,
    symbolic y coords = {User Count, Critic Count, Critic Score, User Score, Platform, Genre, Rating},
    nodes near coords,
  ]
  \addplot coordinates { (100,User Count) (80,Critic Count) (56,Critic Score) (20,User Score) (8.47,Platform) (2.35,Genre) (3.675,Rating) };
  \end{axis}
\end{tikzpicture}
\caption{Results for the 2017 Dataset on what parameters make a successful game.}
\end{figure}
\end{center}

\pgfplotsset{width=5cm,compat=1.15}
\begin{center}
\begin{figure}[h]
\begin{tikzpicture}
  \begin{axis}[title  = \textbf{2019 Data-set Results: Parameters for a Successful game},
    xbar,
    y axis line style = { opacity = 0 },
    axis x line       = none,
    tickwidth         = 0pt,
    ytick             = data,
    enlarge y limits  = 0.05,
    enlarge x limits  = 0.02,
    width=0.3\textwidth,
    bar width=2mm,
    symbolic y coords = {User Count, Critic Count, Critic Score, User Score, Platform, Genre, Rating},
    nodes near coords,
  ]
  \addplot coordinates { (99.8,User Count) (73.6,Critic Count) (71.3,Critic Score) (21,User Score) (9.58,Platform) (2.35,Genre) (4,Rating) };
  \end{axis}
\end{tikzpicture}
\caption{Results for the 2019 Dataset on what parameters make a successful game.}
\end{figure}
\end{center}

\end{document}
Iris
  • 29
  • 4
  • 10
  • Have a look at the subcaption package. Unrelated to your problem: never put a `figure` environment inside a `center` environment. – samcarter_is_at_topanswers.xyz May 12 '20 at 07:34
  • Why is that? Why should you never put a figure inside a center environment? Sorry, kind of a newb at latex. – Iris May 12 '20 at 20:13
  • The one defining characteristic of a `figure` is that it floats, e.g. that tex automatically searches the best possible position. With the center environment your figure is no longer able to float, so there is no point in using a figure environment in the first place, you could just put the content directly into the document. – samcarter_is_at_topanswers.xyz May 12 '20 at 20:27

0 Answers0