1

enter image description here

It is so hard to make the axis name in two lines. and is it possible to make a figure which has two different y axis?

Time vs Number of publications containing the keywords "A + B":

(2006,752) 
(2007,888)
(2008,908) 
(2009,920) 
(2010,1010) 
(2012,1081) 
(2013,1082) 
(2014,1075) 
(2015,1092) 
(2016,1100) 
(2011,1003) 
(2012,1081) 
(2013,1082) 
(2014,1075) 
(2015,1092) 
(2016,1100)

Time vs Number of publications containing the keywords "C + D":

(2006,6) 
(2007,4) 
(2008,4) 
(2009,5) 
(2010,5) 
(2012,9) 
(2013,6) 
(2014,6) 
(2015,2) 
(2016,6) 
(2011,6) 
(2012,11) 
(2013,13) 
(2014,21) 
(2015,22) 
(2016,23)
1

As already stated in the comment below the question creating a graph with two y-axis sharing one x-axis, an example can be found at https://tex.stackexchange.com/a/286098/95441.

Below I show you two different ways (of many others) on how you can provide multi-line axis labels. The "best" implementation depends on your specific requirements.

(I don't provide a full solution answering all your question in one answer here, because I don't see the point showing the "the same thing" one time as a bar-chart and one time as a line. I recommend showing Either both of them as bars or both of them as lines.)

% used PGFPlots v1.16
\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
    \begin{axis}[
        xlabel={This is a very long axis label spanning over two lines},
        xlabel style={
            text width=10em,
        },
        ylabel={This is a very long axis label \\ spanning over two lines},
        ylabel style={
            align=center,
        },
    ]
    \end{axis}
\end{tikzpicture}
\end{document}

image showing the result of above code

|improve this answer|||||
  • 1
    Since you asked several follow-up questions already were the "problem" of multi-line axis labels were solved, it would be nice if you could consider upvoting this answer (by clicking on the arrows next to the score) and/or marking it as the accepted answer (by clicking on the checkmark ✓) if it helped you. – Stefan Pinnow Sep 2 '18 at 5:15

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.