绘制不成比例的数据集

绘制不成比例的数据集

我针对三种情况解决了一个优化问题。我打算将结果绘制为组图(本质上是 3 乘 1 组图)。由于我在每个图中展示了六组数据,因此我得到了如下所示的图表:在此处输入图片描述

由于数据集不成比例,我们观察到 3 个数据集的近乎平行的线,而其他线则显示系统设计成本相对于路由成本增加。我希望近乎平行的线也显示系统设计成本增加。然而,这些信息被抑制了。你能为这种异常提出一些替代方案吗?请在此处找到代码

  \begin{tikzpicture}[every mark/.append style={mark size=.7pt}]
    \begin{axis}[
                scale=0.81,
                legend style={
                at = {(.48,-.8)},anchor=south},%at={(0.5,-0.34)},anchor=north},
                %legend columns = -1,
                xmin=0,xmax=50,
                ymin=0,ymax=400000,
                ymode = log,
                xlabel={routing costs},
                ylabel={system design costs},
                legend style={font=\small}]

\addplot
    coordinates {
        (0, 310006.712271894)
        (10, 312781.712271894)
        (20, 315556.712271894)
        (30, 318331.712271894)
        (40, 321106.712271894)
        (50, 323881.712271894)
    };\addlegendentry{Centralised RAN}
    
\addplot+
    coordinates {
        (0, 237.689033351856)
        (10, 535.932112624024)
        (20, 834.175191896192)
        (30, 1132.41827116836)
        (40, 1430.66135044053)
        (50, 1728.90442971269)
    };\addlegendentry{Distributed RAN}
    
\addplot+
    coordinates {
        (0, 47.5517657268742)
        (10, 404.104349185922)
        (20, 709.528125267976)
        (30, 1014.06344997298)
        (40, 1317.76112473382)
        (50, 1620.73092429476)     }
    ;\addlegendentry{Fluid RAN}
      \addplot+          coordinates {
        (0, 310007.104063121)
        (10, 312782.104063121)
        (20, 315557.104063121)
        (30, 318332.104063121)
        (40, 321107.104063121)
        (50, 323882.104063121)
    };\addlegendentry{Centralised RAN - HIGH}
    
\addplot+
    coordinates {
        (0, 93699.4500521545)
        (10, 94466.4160045098)
        (20, 95233.3819568651)
        (30, 96000.3479092204)
        (40, 96767.3138615757)
        (50, 97534.279813931)
    };\addlegendentry{Distributed RAN - HIGH}
    
\addplot+
    coordinates {
        (0, 90079.5312740768)
        (10, 90995.7138828325)
        (20, 91787.0309120226)
        (30, 92568.9759214698)
        (40, 93347.4344093317)
        (50, 94123.854677605)
    };\addlegendentry{Fluid RAN - HIGH}
    
 \end{axis}
\end{tikzpicture} 

答案1

只是为了好玩,我创建了一个部分线性/部分半对数图。

演示

\documentclass{standalone}
\usepackage{pgfplots}
\usetikzlibrary{calc}

\begin{document}
\begin{tikzpicture}[every mark/.append style={mark size=.7pt}]
    \begin{axis}[name=lower,
                scale=0.81,
                height=3cm, width=6cm, scale only axis,
                xmin=0,xmax=50,
                ymin=0,ymax=50000,
                ymode = log,
                xlabel={routing costs},
                ylabel={\hspace*{2.5cm}system design costs},
                ylabel shift=2cm,
                legend to name=part1,
                legend style={font=\small}]
\addplot+
    coordinates {
        (0, 47.5517657268742)
        (10, 404.104349185922)
        (20, 709.528125267976)
        (30, 1014.06344997298)
        (40, 1317.76112473382)
        (50, 1620.73092429476)     }
    ;\addlegendentry{Fluid RAN}
\addplot+
    coordinates {
        (0, 237.689033351856)
        (10, 535.932112624024)
        (20, 834.175191896192)
        (30, 1132.41827116836)
        (40, 1430.66135044053)
        (50, 1728.90442971269)
    };\addlegendentry{Distributed RAN}
\end{axis}
    
\begin{axis}[shift=(lower.north west),
        scale=0.81,
        height=3cm, width=6cm, scale only axis,
        xticklabels={}, cycle list shift=2,
        xmin=0,xmax=50,
        ymin=50000,ymax=400000,
        legend to name=part2,
        legend style={font=\small}]

\addplot
    coordinates {
        (0, 310006.712271894)
        (10, 312781.712271894)
        (20, 315556.712271894)
        (30, 318331.712271894)
        (40, 321106.712271894)
        (50, 323881.712271894)
    };\addlegendentry{Centralised RAN}    
    

      \addplot+          coordinates {
        (0, 310007.104063121)
        (10, 312782.104063121)
        (20, 315557.104063121)
        (30, 318332.104063121)
        (40, 321107.104063121)
        (50, 323882.104063121)
    };\addlegendentry{Centralised RAN - HIGH}
    
\addplot+
    coordinates {
        (0, 93699.4500521545)
        (10, 94466.4160045098)
        (20, 95233.3819568651)
        (30, 96000.3479092204)
        (40, 96767.3138615757)
        (50, 97534.279813931)
    };\addlegendentry{Distributed RAN - HIGH}
    
\addplot+
    coordinates {
        (0, 90079.5312740768)
        (10, 90995.7138828325)
        (20, 91787.0309120226)
        (30, 92568.9759214698)
        (40, 93347.4344093317)
        (50, 94123.854677605)
    };\addlegendentry{Fluid RAN - HIGH}
    
 \end{axis}

\node[below=1cm,align=center] at (lower.south) {\pgfplotslegendfromname{part1}\\
  \pgfplotslegendfromname{part2}};
\end{tikzpicture} 
\end{document}

相关内容