0

I have a graph and I want to plot on the Y axis figures instead of numbers or text.

My code is the following:

\begin{tikzpicture} 
\begin{axis}
[ 
xbar, xmin=0, xmax=10, 
width=7cm, height=8cm, enlarge y limits=0.5, 
xlabel={Closeness to the base firm}, 
symbolic y coords={
    \includegraphics[scale=0.022]{Logo/intellogo.png},
    \includegraphics[scale=0.02]{Logo/HPlogo.png},
    \includegraphics[scale=0.02]{Logo/nvidialogo.png},
    \includegraphics[scale=0.03]{Logo/broadcomlogo.png},
    \includegraphics[scale=0.035]{Logo/texasinstrumentslogo.png},
    \includegraphics[scale=0.055]{Logo/googlelogo.png},
    \includegraphics[scale=0.14]{Logo/microsoftlogo4.png}
    },
ytick=data, 
nodes near coords, nodes near coords align={horizontal}] 
\addplot[xbar,fill={rgb:red,0;green,47;blue,135}] coordinates {
(10, \includegraphics[scale=0.022]{Logo/intellogo.png})
(9, \includegraphics[scale=0.02]{Logo/HPlogo.png})
(8, \includegraphics[scale=0.02]{Logo/nvidialogo.png})
(7, \includegraphics[scale=0.03]{Logo/broadcomlogo.png})
(6, \includegraphics[scale=0.035]{Logo/texasinstrumentslogo.png})
(5, \includegraphics[scale=0.055]{Logo/googlelogo.png})
(4, \includegraphics[scale=0.14]{Logo/microsoftlogo4.png})
}; 
\end{axis} 
\end{tikzpicture}

It currently looks like this:

enter image description here

I would like to have all the logos displayed on the Y axis in the order of the y value mentioned in the \addplot {} section

0

I managed to make it work. I removed the enlarge y limits. Apparently, it was making it overlay on top of each other.

\begin{tikzpicture} 
\begin{axis}
[ 
xbar, xmin=0, xmax=8,
width=7cm, height=10cm,
xlabel={Closeness to the base firm}, 
symbolic y coords={
    \includegraphics[scale=0.022]{Logo/intellogo.png},
    \includegraphics[scale=0.02]{Logo/HPlogo.png},
    \includegraphics[scale=0.02]{Logo/nvidialogo.png},
    \includegraphics[scale=0.03]{Logo/broadcomlogo.png},
    \includegraphics[scale=0.035]{Logo/texasinstrumentslogo.png},
    \includegraphics[scale=0.055]{Logo/googlelogo.png},
    \includegraphics[scale=0.14]{Logo/microsoftlogo4.png}
    },
ytick=data, 
nodes near coords, nodes near coords align={horizontal}] 
\addplot[xbar,fill={rgb:red,0;green,47;blue,135}] coordinates 
{
(8,\includegraphics[scale=0.022]{Logo/intellogo.png})
(7,\includegraphics[scale=0.02]{Logo/HPlogo.png})
(6,\includegraphics[scale=0.02]{Logo/nvidialogo.png})
(5,\includegraphics[scale=0.03]{Logo/broadcomlogo.png})
(4,\includegraphics[scale=0.035]{Logo/texasinstrumentslogo.png})
(3,\includegraphics[scale=0.055]{Logo/googlelogo.png})
(2,\includegraphics[scale=0.14]{Logo/microsoftlogo4.png})
}; 
\end{axis} 
\end{tikzpicture}

Now it looks properly: enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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