我有一个如下所示的雷达图,但是我不确定为什么我会遇到“尺寸太大”的错误。
\documentclass[]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[upright]{fourier}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{tkz-kiviat,numprint,fullpage}
\usepackage{pgfplotstable}
\usetikzlibrary{arrows}
\thispagestyle{empty}
\usepackage{filecontents}
% the filecontents environment writes its content to the specified file
\begin{filecontents*}{data.dat}
c1 c2 c3 c4
i1 21 26 53
i2 38 10 52
i3 81 1 18
i4 63 0 37
i5 63 0 37
i6 34 0 66
i7 62 0 38
i8 40 0 60
i9 53 0 47
i10 54 0 46
i11 61 0 39
i12 15 3 82
i13 83 1 16
i14 41 2 57
i15 77 0 23
i16 100 0 0
i17 72 0 28
i18 66 0 34
i19 86 0 14
i20 81 0 19
i21 32 0 68
i22 49 0 51
i23 25 1 74
i24 88 0 12
i25 48 3 49
i26 87 0 13
i27 48 0 52
i28 92 0 8
i29 43 0 57
i30 60 0 40
i31 60 0 40
i32 33 0 67
i33 26 0 74
i34 70 0 30
i35 95 0 5
i36 0 0 100
i37 43 0 57
i38 27 0 73
i39 67 0 33
i40 26 0 74
i41 20 0 80
i42 21 0 79
i43 22 0 78
i44 16 0 84
i45 99 0 1
i46 55 0 45
i47 25 0 75
i48 28 0 72
i49 13 0 87
i50 23 0 77
i51 9 0 91
i52 7 0 93
i53 5 0 95
i54 0 0 100
i55 { } 0 100
i56 { } 0 10
i57 { } 0 68
i58 { } 0 84
i59 { } 0 90
i60 { } 0 93
i61 { } 0 91
i62 { } 0 100
i63 { } 0 100
i64 { } 0 100
i65 { } 0 100
i66 { } 0 100
\end{filecontents*}
\begin{document}
\begin{tikzpicture}
\tkzKiviatDiagramFromFile[
scale=0.5,
label distance=.5cm,
gap = 10, label space=3,
lattice = 100]{data.dat}
\tkzKiviatLineFromFile[thick,
color = green,
mark = ball,
ball color = green,
mark size = 4pt,
fill = green!20]{data.dat}{3}
\tkzKiviatLineFromFile[thick,
color = blue,
mark = ball,
ball color = blue,
mark size = 4pt,
fill = blue!20]{data.dat}{2}
\tkzKiviatLineFromFile[thick,
color = red,
mark = ball,
ball color = red,
mark size = 4pt,
fill = red!20]{data.dat}{1}
\end{tikzpicture}
\end{document}
答案1
稍微调整一下参数,注释掉最后一条tkzKiviatLineFromFile
导致错误太多的命令treated as zero
,得到了下面的图片:
\documentclass[]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[upright]{fourier}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{tkz-kiviat,numprint,fullpage}
\usepackage{pgfplotstable}
\usetikzlibrary{arrows}
\thispagestyle{empty}
\usepackage{filecontents}
% the filecontents environment writes its content to the specified file
\begin{filecontents*}{data.dat}
c1 c2 c3 c4
i1 21 26 53
i2 38 10 52
i3 81 1 18
i4 63 0 37
i5 63 0 37
i6 34 0 66
i7 62 0 38
i8 40 0 60
i9 53 0 47
i10 54 0 46
i11 61 0 39
i12 15 3 82
i13 83 1 16
i14 41 2 57
i15 77 0 23
i16 100 0 0
i17 72 0 28
i18 66 0 34
i19 86 0 14
i20 81 0 19
i21 32 0 68
i22 49 0 51
i23 25 1 74
i24 88 0 12
i25 48 3 49
i26 87 0 13
i27 48 0 52
i28 92 0 8
i29 43 0 57
i30 60 0 40
i31 60 0 40
i32 33 0 67
i33 26 0 74
i34 70 0 30
i35 95 0 5
i36 0 0 100
i37 43 0 57
i38 27 0 73
i39 67 0 33
i40 26 0 74
i41 20 0 80
i42 21 0 79
i43 22 0 78
i44 16 0 84
i45 99 0 1
i46 55 0 45
i47 25 0 75
i48 28 0 72
i49 13 0 87
i50 23 0 77
i51 9 0 91
i52 7 0 93
i53 5 0 95
i54 0 0 100
i55 { } 0 100
i56 { } 0 10
i57 { } 0 68
i58 { } 0 84
i59 { } 0 90
i60 { } 0 93
i61 { } 0 91
i62 { } 0 100
i63 { } 0 100
i64 { } 0 100
i65 { } 0 100
i66 { } 0 100
\end{filecontents*}
\begin{document}
\begin{tikzpicture}
\tkzKiviatDiagramFromFile[
scale=0.2,
label distance=.5cm,
gap = 10pt, label space=3pt,
lattice = 100pt]{data.dat}
\tkzKiviatLineFromFile[thick,
color = green,
mark = ball,
ball color = green,
mark size = 4pt,
fill = green!20]{data.dat}{3}
\tkzKiviatLineFromFile[thick,
color = blue,
mark = ball,
ball color = blue,
mark size = 4pt,
fill = blue!20]{data.dat}{2}
%\tkzKiviatLineFromFile[thick,
% color = red,
% mark = ball,
% ball color = red,
% mark size = 4pt,
% fill = red!20]{data.dat}{1}
\end{tikzpicture}
\end{document}