TikZ 图片数据可视化的字体大小

TikZ 图片数据可视化的字体大小

这是后续问题:设置 TikZ 图形的字体大小

正如我提到的,我根据字体大小设计图片,因此,如果我可以为每张图片设置特定的字体大小,那么对我来说就很好了,这样更改文档中的字体大小就不会迫使我调整图片。虽然前面的问题通常都很好用,但对 来说却不行tikz-datavisualization

尝试更改作为参数传递给文档类的字体大小。您会注意到大小发生了2变化,但1看起来保持一致。

我想为整个文档全局设置刻度线使用的字体大小;我该怎么做?(或者有没有办法让之前的修复与数据可视化的轴一起工作?)

梅威瑟:

\documentclass[12pt]{report}
\usepackage{tikz}
\usetikzlibrary{datavisualization}

\tikzset{every picture/.style={font issue={\fontsize{10}{12}}}, %fix from https://tex.stackexchange.com/questions/122235/set-fontsize-for-tikz-figure, affects for instance the text above the legend ("MyLabel"), but not the labels of the lines in the legend
         font issue/.style={execute at begin picture={#1\selectfont}}
        }

\begin{document}
\begin{tikzpicture}
\datavisualization [scientific axes=clean,
visualize as line/.list={1,2,4},
x axis={
    ticks={
        step=2,
        minor steps between steps=3,
        major ={
            also at={1 as [{tick text padding=2ex, style={text height=1.2ex}, node style={font={\it}}}]},
        },          
    },
},
1={label in legend={text=1-way}},
legend={matrix node style={label=MyLabel, xshift=-1ex}}]
data {
%normed on worst time
x, y
1, 2
2, 3
3, 2
};
\end{tikzpicture}
\end{document}

相关内容