Skip to content

Instantly share code, notes, and snippets.

@marvk
Created July 7, 2020 19:10
Show Gist options
  • Save marvk/6099774a981ccfee7c05126b3f0922f0 to your computer and use it in GitHub Desktop.
Save marvk/6099774a981ccfee7c05126b3f0922f0 to your computer and use it in GitHub Desktop.
\begin{figure}
\centering
\begin{tikzpicture}
\pgfplotstableread[col sep = comma]{contents/data/ground-truth/Result_25.csv}\loadedtable
\begin{axis}
[
ybar,
bar width=.5cm,
width=0.9\textwidth,
height=.5\textwidth,
xtick=data,
xtick pos=bottom,
ytick pos=left,
ylabel={\#Sätze},
xticklabels = {
\includegraphics[scale=0.2]{contents/figures/appstore-logo.png},
\includegraphics[scale=0.2]{contents/figures/playstore-logo.png},
\includegraphics[scale=0.2]{contents/figures/appstore-logo.png},
\includegraphics[scale=0.2]{contents/figures/playstore-logo.png},
\includegraphics[scale=0.2]{contents/figures/appstore-logo.png},
\includegraphics[scale=0.2]{contents/figures/playstore-logo.png},
\includegraphics[scale=0.2]{contents/figures/appstore-logo.png},
\includegraphics[scale=0.2]{contents/figures/playstore-logo.png},
\includegraphics[scale=0.2]{contents/figures/appstore-logo.png},
\includegraphics[scale=0.2]{contents/figures/playstore-logo.png},
\includegraphics[scale=0.2]{contents/figures/appstore-logo.png},
\includegraphics[scale=0.2]{contents/figures/playstore-logo.png},
},
bar width=3,
ybar=0,
legend style={font=\tiny,at={(0.15,0.98)},anchor=north west},
]
\addplot[fill=black!10!white] table[x expr=\coordindex-0.15, y=v1]{\loadedtable};
\addlegendentry{\faStar\faStarO\faStarO\faStarO\faStarO};
\addplot[fill=black!30!white] table[x expr=\coordindex-0.15, y=v2]{\loadedtable};
\addlegendentry{\faStar\faStar\faStarO\faStarO\faStarO};
\addplot[fill=black!50!white] table[x expr=\coordindex-0.15, y=v3]{\loadedtable};
\addlegendentry{\faStar\faStar\faStar\faStarO\faStarO};
\addplot[fill=black!70!white] table[x expr=\coordindex-0.15, y=v4]{\loadedtable};
\addlegendentry{\faStar\faStar\faStar\faStar\faStarO};
\addplot[fill=black!90!white] table[x expr=\coordindex-0.15, y=v5]{\loadedtable};
\addlegendentry{\faStar\faStar\faStar\faStar\faStar};
\end{axis}
\begin{axis}
[
ybar,
bar width=.5cm,
width=0.9\textwidth,
height=.5\textwidth,
xtick=\empty,
ytick pos=right,
xticklabels={,,},
ylabel={\#Sätze pro Review},
]
\addplot[fill=none,draw=none] table[x expr=\coordindex-0.15, y expr=\thisrow{v1}*0.05]{\loadedtable};
\addplot[fill=none,draw=none] table[x expr=\coordindex-0.15, y expr=\thisrow{v2}*0.05]{\loadedtable};
\addplot[fill=none,draw=none] table[x expr=\coordindex-0.15, y expr=\thisrow{v3}*0.05]{\loadedtable};
\addplot[fill=none,draw=none] table[x expr=\coordindex-0.15, y expr=\thisrow{v4}*0.05]{\loadedtable};
\addplot[fill=none,draw=none] table[x expr=\coordindex-0.15, y expr=\thisrow{v5}*0.05]{\loadedtable};
\end{axis}
\newcommand\off{0.65}
\begin{axis}[
ybar,
bar width=.5cm,
width=0.9\textwidth,
height=.5\textwidth,
xticklabels = {Google Maps,Medscape,MyChart,Turbo Tax,United Airlines,Venmo},
xtick={0-\off,2-\off,4-\off,6-\off,8-\off,10-\off,12-\off},
bar width=0,
yticklabels={,,},
major tick length=23,
ytick=\empty,
xticklabel style={rotate=90},
x tick label style={yshift=-1.9em},
% x tick label style={yshift={-mod(\ticknum,2)*1em},xshift=2.2em},
xtick pos=bottom,
]
\addplot[fill=none,draw=none] table[x expr=\coordindex-0.15, y=v1]{\loadedtable};
\addplot[fill=none,draw=none] table[x expr=\coordindex-0.15, y=v2]{\loadedtable};
\addplot[fill=none,draw=none] table[x expr=\coordindex-0.15, y=v3]{\loadedtable};
\addplot[fill=none,draw=none] table[x expr=\coordindex-0.15, y=v4]{\loadedtable};
\addplot[fill=none,draw=none] table[x expr=\coordindex-0.15, y=v5]{\loadedtable};
\end{axis}
\end{tikzpicture}
\caption{test}
\label{fig:test}
\end{figure}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment