我使用 TikZ 的数据可视化库。我有一个包含多个集合的散点图。我为绘图标记设置了首选样式表组合。这些是有序的。我还添加了图例文本。现在,由于不同集合的语义含义(反映在图例文本长度中),最好以某种方式对它们进行分组。该分组与绘图标记顺序和任何可用的图例方向策略不兼容。它与反向图例方向策略兼容。如果我可以插入空的图例条目,我也可以修复它。
最小示例:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{datavisualization,plotmarks}
\begin{document}
\begin{tikzpicture}
\datavisualization [
scientific axes={inner ticks},
x axis={
attribute=x,
label={meaning of $x$ axis},
logarithmic,min value=10,max value=50000,
ticks={minor steps between steps}
},
y axis={
attribute=y,
label={meaning of $y$ axis},
min value=18.5,max value=29.5,
ticks={minor steps between steps=1}
},
all axes=grid,
visualize as scatter/.list={G,GF,simple,combined,new},
legend={above,columns=2},
% the following two should fill a column
G={label in legend={text={a bit longer}}},
GF={label in legend={text=short}},
% the following three should fill another column
simple={label in legend={text={quite a bit longer (simple, old)}}},
combined={label in legend={text={quite a bit longer (combined, old)}}},
new={label in legend={text={quite a bit longer (multiple)}}},
style sheet=cross marks,
style sheet=strong colors
]
data [set=G] {
x, y
17513, 21.4
1000 , 19.8
2988 , 19.5
30113, 28.9
600 , 23.0
31979, 21.2
}
data [set=GF] {
x, y
6000 , 27.4
}
data [set=simple] {
x, y
71 , 24.3
}
data [set=combined] {
x, y
40 , 22.6
}
data [set=new] {
x, y
180 , 21.6
};
\end{tikzpicture}
\end{document}