![编辑](https://linux22.com/image/350772/%E7%BC%96%E8%BE%91.png)
我有以下 Latex 代码来绘制蜘蛛车。但是,我需要比例增加 5,换句话说;0、5、10……等等,而不是增加 1。
\documentclass[]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[upright]{fourier}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{tkz-kiviat,numprint,fullpage}
\usetikzlibrary{arrows}
\thispagestyle{empty}
\begin{document}
\begin{tikzpicture}
\tkzKiviatDiagram[radial style/.style={gray!50}, scale=0.2, gap=1, lattice=35]{A,B,C,D,E,F}
\tkzKiviatLine[ ultra thick, color=red, mark=ball, ball color=red,mark size=12pt](5,5,5,5,5,5)
\tkzKiviatLine[ ultra thick, color=blue, mark=ball, ball color=red,mark size=12pt](10,10,10,10,10,10)
\tkzKiviatLine[ ultra thick, color=gray, mark=ball, ball color=red,mark size=12pt](15,15,15,15,15,15)
\tkzKiviatLine[ ultra thick, color=green, mark=ball, ball color=red,mark size=12pt](20,20,20,20,20,20)
\tkzKiviatLine[ ultra thick, color=yellow,mark=ball, ball color=red,mark size=12pt](25,25,25,25,25,25)
\tkzKiviatLine[ ultra thick, color=pink ,mark=ball, ball color=red,mark size=12pt](30,30,30,30,30,30)
\tkzKiviatGrad[](6)
\end{tikzpicture}
\end{document}
答案1
以下工作
\documentclass[tikz,border=9]{standalone}
\usepackage{tkz-kiviat}
\begin{document}
\pgfkeys{
/kiviatgrad/simplify label/.code={
\ifx\nv\undefined\else
\pgfmathparse{Mod(\nv,5)}
\ifdim\pgfmathresult pt>0pt
\tikzset{opacity=0}
\fi
\fi
}
}
\begin{tikzpicture}
\tkzKiviatDiagram[radial style/.style={gray!50}, scale=0.2, gap=1,, lattice=35]{A,B,C,D,E,F}
\tkzKiviatGrad[simplify label=5](6)
\end{tikzpicture}
\end{document}
编辑
正如@percusse 所建议的,你应该%
在每行末尾添加。否则最终结果可能会有多余的空格。我不清楚哪个换行符导致了多余的空格。所以最好的方法是保留%
所有行。