tikzpictures 未垂直对齐 + 平滑图问题

tikzpictures 未垂直对齐 + 平滑图问题

这就是我想重现的内容:

在此处输入图片描述

\documentclass{article} 
\usepackage{tikz}
 \usetikzlibrary{colorbrewer}
 \usepackage{environ}
\usetikzlibrary{chains}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[spanish]{babel}
\usepackage{lmodern}
\usepackage{adjustbox}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}

\pagestyle{empty}

\begin{document}

\begin{adjustbox}{width=\textwidth}
\begin{tikzpicture}
 \begin{axis}[
 height=9cm,
    width=\textwidth,
    enlarge x limits=-1, 
            xmin=0,xmax=10,
            xlabel={},
            ymin=-3,ymax=5,
        xtick=\empty,
        xticklabels={},
        ytick=\empty,
        yticklabels={},
        xlabel={},  
        ylabel={Free Cash Flow},
        axis lines=middle] 
\addplot[smooth,color=red, ultra thick, mark=x]
    coordinates {
        (0,0)
        (1,-1)
        (2,-2)
        (3,0)
        (4,1)
        (5,2)
        (6.5,2.5)
        (7.8, 2.0)
        (8.0, 1.8)
        (9.3, 3.2)
        (10.5,4.9)
    };
\end{axis}
\end{tikzpicture}
\end{adjustbox}
%\begin{tikzpicture}[scale=0.50],
%\begin{adjustbox}{width=\textwidth}
\begin{itemize}
\item[]
\begin{tikzpicture}[scale=0.50, start chain, 
    every node/.style={on chain},
    bloc/.style={fill=Blues-7-7, 
        minimum width=1.8 cm, minimum height=1.2cm, 
        text=white, font=\sffamily, align=center,   
        outer sep=0pt},
    node distance=7pt,
    ]
    \node[bloc] {Seed};
    \node[bloc] {Startup};
    \node[bloc]{Expansion};
    \node[bloc, fill=Greys-9-5]{Turn-\\around};
    \node[bloc, fill=Greys-9-5]{Replace-\\ment};
    \node[bloc, fill=Greys-9-7]{MBO/MBI};
     \node[bloc, fill=Greys-9-7]{LBO};
\end{tikzpicture}
\item[]
\begin{tikzpicture}[scale=0.50, start chain, 
    every node/.style={on chain},
    bloc/.style={fill=Blues-7-7, 
        minimum width=5.9cm, minimum height=0.75cm, 
        text=white, font=\sffamily, align=center,   
        outer sep=5pt},
    node distance = -1.8pt
    ]
    \node[bloc] {Early stage \& Expansion};
      \node[bloc, fill=Greys-9-5, minimum width=3.8cm]{Special Situations};
        \node[bloc, fill=Greys-9-7,minimum width=3.8cm]{Leveraged Finance};
\end{tikzpicture}
\item[]
\begin{tikzpicture}[scale=0.50,start chain,
    every node/.style={on chain},
    bloc/.style={fill=Set1-7-5, 
        minimum width=5.9cm, minimum height=0.75cm, 
        text=white, font=\sffamily, align=center,   
        outer sep=0pt},
    node distance = 0pt
    ]
    \node[bloc] {Business Angels};
\end{tikzpicture}
\item[]
\begin{tikzpicture}[scale=0.50,start chain,
every node/.style={on chain},
    bloc/.style={fill= Greys-9-1, 
        minimum width=2cm, minimum height=0.75cm, 
        text=white, font=\sffamily, align=center,   
        outer sep=0pt},
    node distance = 7pt
    ]
    \node[bloc]{};
    \node[bloc, fill=Set1-7-5,minimum width= 3.7cm]{Venture Capital};   
    \end{tikzpicture}
    \item[]
\begin{tikzpicture}[scale=0.50,start chain,
every node/.style={on chain},
    bloc/.style={fill= Greys-9-1, 
        minimum width=2.9cm, minimum height=0.75cm, 
        text=white, font=\sffamily, align=center,   
        outer sep=0pt},
    node distance = 7pt
    ]
    \node[bloc]{};
    \node[bloc]{};
    \node[bloc, fill=Set1-7-5,minimum width= 7.8cm]{Private Equity};   
\end{tikzpicture}
\end{itemize}
\end{document}

答案1

我不知道图的问题到底是什么。当然,它和你的图像不一样,但这只是使用不同坐标的问题,这样你就可以毫无问题地自行修复。因此,我对图本身所做的唯一改变就是删除标记(mark=none)。我还删除了一些不必要的axis选项,并更改了的样式ylabel

对于盒子,我把所有东西都移到了同一个 中tikzpicture,我认为这在将东西彼此相对放置时更有意义。下面使用的方法可能不是最好的,但我认为它能满足您的要求。基本上我只是text width根据\textwidth、一行中的块数、块之间的间隔和来计算每个节点的inner sep。定义了一些宏以使其更灵活一些。

在此处输入图片描述

\documentclass{article} 
\usepackage{pgfplots}
\usetikzlibrary{colorbrewer}
\usetikzlibrary{chains}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[spanish]{babel}
\usepackage{lmodern}
\usepackage{adjustbox}

\pgfplotsset{compat=newest}

\pagestyle{empty}

\begin{document}
\noindent\begin{tikzpicture}[
    bloc/.style={fill=Blues-G,
        text=white,
        font=\sffamily\scriptsize,
        align=center,   
        outer sep=0pt,
        inner sep=\InnerSep
        },
    node distance=\BlockSep
    ]

\newcommand{\BlockSep}{7pt}
\newcommand{\InnerSep}{0.333em}
\pgfmathsetmacro{\SmallBlockTxtWidth}{(\textwidth-6*\BlockSep-14*\InnerSep)/7}

\begin{axis}[
   name=ax,
   height=9cm,
   width=\textwidth,
   scale only axis,
   xmin=0,xmax=10,
   ymin=-3,ymax=5,
   xtick=\empty,
   ytick=\empty,
   ylabel={Free Cash Flow},
   axis lines=middle,
   ylabel style={bloc,fill=Set1-E,xshift=3pt},
] 

\addplot[smooth,color=red, ultra thick, mark=none]
    coordinates {
        (0,0)
        (1,-1)
        (2,-2)
        (3,0)
        (4,1)
        (5,2)
        (6.5,2.5)
        (7.8, 2.0)
        (8.0, 1.8)
        (9.3, 3.2)
        (10.5,4.9)
    };
\end{axis}

\begin{scope}[
    start chain=1, 
    every node/.style={
       on chain=1,
       bloc,
       text width=\SmallBlockTxtWidth,
       minimum height=1.2cm},
    ]
    \node [below=3pt,anchor=north west] at (ax.south west) {Seed};
    \node {Startup};
    \node {Expansion};
    \node[fill=Greys-E]{Turn-\\around};
    \node[fill=Greys-E]{Replace-\\ment};
    \node[fill=Greys-G]{MBO/MBI};
    \node[fill=Greys-G]{LBO};
\end{scope}

\begin{scope}[
    start chain=2,
    every node/.style={
      on chain,
      bloc
    }
    ]
    \node [below=3pt,anchor=north west,text width=\SmallBlockTxtWidth*3+2*\BlockSep+4*\InnerSep] at (1-1.south west) {Early stage \& Expansion};
    \node[fill=Greys-E, text width=\SmallBlockTxtWidth*2+\BlockSep+2*\InnerSep]{Special Situations};
    \node[fill=Greys-G,text width=\SmallBlockTxtWidth*2+\BlockSep+2*\InnerSep]{Leveraged Finance};
\end{scope}

\begin{scope}[
    every node/.style={
       bloc,
       fill=Set1-E,
       align=left
    }
    ]
    \node [below=3pt,anchor=north west,text width=\SmallBlockTxtWidth*2+2*\BlockSep+2*\InnerSep] (ba) at (2-1.south west) {Business Angels};
   \node [below=3pt,anchor=north east,text width=\SmallBlockTxtWidth*2] (vc) at (ba.south -| 2-1.east) {Venture Capital};   
    \node [below=3pt,anchor=north east,text width=\SmallBlockTxtWidth*4+4*\BlockSep+6*\InnerSep] at (vc.south -| 2-3.east) {Private Equity};   
\end{scope}
\end{tikzpicture}

\end{document}

相关内容