我有一个包含许多 Tikz 文件的 TeX 文档。我正在使用 TeXmaker 编辑和编译我的 Latex 文档。在我的所有 Tikz 图形中,图形都已绘制,但其中没有曲线,并且我遇到了很多这些错误:
Missing character: There is no 0 in font nullfont!
Missing character: There is no 0 in font nullfont!
Missing character: There is no 7 in font nullfont!
Missing character: There is no 0 in font nullfont!
Missing character: There is no 0 in font nullfont!
Missing character: There is no 9 in font nullfont!
...
代码如下:
\pdfoutput=1
\documentclass[conference]{IEEEtran}
\pagestyle{plain}
\let\labelindent\relax
%\usepackage[draft,inline,nomargin]{fixme}
\usepackage{url}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{enumitem}
\newlength\figureheight
\newlength\figurewidth
\setlength\figureheight{5cm}
\setlength\figurewidth{7cm}
\newlength\smallfigureheight
\newlength\smallfigurewidth
\setlength\smallfigureheight{5cm}
\setlength\smallfigurewidth{7cm}
\newlength\largefigureheight
\newlength\largefigurewidth
\setlength\largefigureheight{6cm}
\setlength\largefigurewidth{8cm}
\usepackage{tikz}
\usepackage{pgfplots}
%\usetikzlibrary{pgfplots.groupplots}
%\pgfplotsset{compat=1.3}
\usetikzlibrary{external}
%\tikzexternalize[prefix=Figure/]
\usepackage{color}
\usepackage{soul} % for highlighting comments
\usepackage{balance}
%\usepackage{easy-todo}
%\makeatletter\@openrightfalse\makeatother
\newcommand{\paragraphX}[1]{\vskip 4pt \noindent \textbf{#1} \hskip .05in}
%\newenvironment{smitemize}
% {\begin{list}{$\bullet$}
% {\setlength{\parsep}{0pt}
% \setlength{\leftmargin}{10pt}
% \setlength{\topsep}{-7pt}
% \setlength{\labelwidth}{5pt}
% \setlength{\itemsep}{1pt}}}
% {\end{list}}
\let\oldenumerate\enumerate
\renewcommand{\enumerate}{
\oldenumerate
\setlength{\topsep}{-7pt}
\setlength{\leftmargin}{0pt}
\setlength{\labelwidth}{0pt}
\setlength{\itemsep}{2pt}
\setlength{\parskip}{0pt}
\setlength{\parsep}{0pt}
}
\setlist[enumerate]{leftmargin=*}
\setlist[itemize]{leftmargin=0.5cm}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage[numbers]{natbib}
\graphicspath{{./Figures/}}
\begin{document}
\title{Hello World}
% author names and affiliations
% use a multiple column layout for up to three different
% affiliations
\author{\IEEEauthorblockN{Anonymous}
\IEEEauthorblockA{Anonymous}}
\IEEEoverridecommandlockouts
\makeatletter\def\@IEEEpubidpullup{9\baselineskip}\makeatother
\IEEEpubid{\parbox{\columnwidth}{Permission
}
\hspace{\columnsep}\makebox[\columnwidth]{}}
% make the title area
\maketitle
\begin{figure*}[t]
\centering
\begin{tikzpicture}
\definecolor{color1}{rgb}{0.75,0.75,0}
\definecolor{color0}{rgb}{0,0.75,0.75}
\begin{axis}[
ylabel={rate},
xmin=0, xmax=20,
ymin=0, ymax=0.1,
axis on top,
width=0.82\figurewidth,
height=0.78\figureheight,
xtick={0,5,10,15,20},
xticklabels={$0$,$5$,$10$,$15$,$20$},
ytick={0,0.02,0.04,0.06,0.08,0.1},
yticklabels={$0.00$,$0.02$,$0.04$,$0.06$,$0.08$,$0.10$},
xmajorgrids,
ymajorgrids,
legend style={at={(-0.42,0.97)}},
%legend pos=outer north east,
legend style={font=\fontsize{8}{8}\selectfont},
legend entries={{$\alpha$ = 0.9},{$\alpha$ = 0.8}},
%legend cell align={left}
]
\addplot [very thin, red, mark=*, mark size=3, mark options={solid,draw=black}]%1
table {%
1 1.1
3 3.2
5 4.3
7 3.6
10 3.33
15 3.2
20 3.9
};
\addplot [very thin, green!50.0!black, mark=x, mark size=3, mark options={solid}]%2
table {%
1 2.1
3 2.2
5 2.3
7 3.3
10 3.4
15 3.5
20 3.6
};
\end{axis}
\end{tikzpicture}
\caption{{\bf Selection:} Users.}
\label{fig:ci}
\end{figure*}
%\bibliographystyle{abbrv}
%\bibliography{refs}
%\appendix
%\input{appendix}
\end{document}
我认为乳胶跳过了所有数字,\addplots
导致图形中没有曲线。
答案1
您正在绘制所有y
值对 的图x=0
,对吗?如果您改变 的值x
,您会得到一个结果(尽管可能不是您想要的特定结果):
【概率怎么会超过1?!】
\documentclass[border=10pt,multi,tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\newlength\figureheight
\newlength\figurewidth
\setlength\figureheight{5cm}
\setlength\figurewidth{7cm}
\begin{document}
\begin{tikzpicture}
\definecolor{color1}{rgb}{0.75,0,0.75}
\definecolor{color0}{rgb}{0,0.75,0.75}
\begin{axis}[
xlabel={stream},
ylabel={Cumulative probability},
xmin=0, xmax=303,
ymin=0, ymax=0.0162,
axis on top,
width=1.3\figurewidth,
height=1.2\figureheight,
xtick={30,90,150,210,270},
xticklabels={Mar,May, July,Sept,Dec},
xmajorgrids,
ymajorgrids,
mark repeat={10},
ytick={0,0.002,0.004,0.006,0.008,0.01,0.012,0.014,0.016,0.018},
%yticklabels={0.000,0.002,0.004,0.006,0.008,0.010,0.012,0.014,0.016,0.018},
xmajorgrids,
ymajorgrids,
%legend pos=outer north east,
legend pos=south east,
legend entries={{$\alpha$=0.0, low},{$\alpha$=0.0, high}},
legend cell align={left}
%legend columns=-1,
%legend to name=named1
%legend style={at={(0.97,0.03)}, anchor=south east}
]
\addplot[thick, blue, mark=triangle*, mark size=3, mark options={solid,rotate=180,draw=black}]
table {%
0 0
40 0.000333333333333333
80 0.000333333333333333
120 0.000666666666666667
160 0.000666666666666667
200 0.001
240 0.001
280 0.00133333333333333
};
\addplot[thick, blue, mark=triangle*, mark size=3, mark options={solid,rotate=180,draw=black}]
table {%
0 0
40 0.000333333333333333
80 0.000333333333333333
120 0.000666666666666667
160 0.000666666666666667
200 0.001
240 0.001
};
\end{axis}
\end{tikzpicture}
\end{document}