Package pgfkeys Error: I do not know the key '/tikz/start' and I am going to ignore it. Perhaps you misspelled it. }
当我想要绘制一个单纯形图时,我收到一条错误消息。我正在使用以下代码:
\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{natbib}
\usepackage[left=2.00cm, right=2.00cm, top=2.00cm, bottom=2.00cm]{geometry}
\usepackage{color}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usepackage{amsthm}
\usepackage{hyperref}
\usepackage{hypcap}
\usepackage[toc,page]{appendix}
\usepackage{mathtools}
\usepackage{mathptmx}
\usepackage{booktabs}
\usepackage{pgfplots}
\pgfplotsset{compat=1.13}
\begin{document}
\begin{figure}[h]
\centering
\caption{Bla bla}
\tdplotsetmaincoords{70}{115}
\begin{tikzpicture}[tdplot_main_coords]
\def\laxis{7}
\def\xtriangle{3}
\def\ytriangle{4}
\def\ztriangle{5}
\def\ltick{.2}
%%% axes
\draw [->] (0,0,0) -- (\laxis,0,0) node [below] {July 15};
\draw [->] (0,0,0) -- (0,\laxis,0) node [right] {July 29};
\draw [->] (0,0,0) -- (0,0,\laxis) node [left] {August 12};
%%% axes ticks
\pgfmathtruncatemacro{\nticks}{floor(\laxis)-1}
\begin{scope}[
help lines,
every node/.style={inner sep=1pt,text=black}
]
\foreach \coord in {1,...,\nticks} {
\draw (\coord,\ltick,0) -- ++(0,-\ltick,0) -- ++(0,0,\ltick)
node [pos=1,left] {\coord};
\draw (\ltick,\coord,0) -- ++(-\ltick,0,0) -- ++(0,0,\ltick)
node [pos=1,right] {\coord};
\draw (\ltick,0,\coord) -- ++(-\ltick,0,0) -- ++(0,\ltick,0)
node [start,above right] {\coord};
}
\end{scope}
%%% figure
\filldraw [opacity=.33,red] (\xtriangle,0,0) -- (0,\ytriangle,0)
-- (0,0,\ztriangle) -- cycle;
\def\x2triangle{6}
\def\y2triangle{5}
\def\z2triangle{2}
\def\ltick{.2}
\begin{scope}[
help lines,
every node/.style={inner sep=1pt,text=black}
]
\foreach \coord in {1,...,\nticks} {
\draw (\coord,\ltick,0) -- ++(0,-\ltick,0) -- ++(0,0,\ltick)
node [pos=1,left] {\coord};
\draw (\ltick,\coord,0) -- ++(-\ltick,0,0) -- ++(0,0,\ltick)
node [pos=1,right] {\coord};
\draw (\ltick,0,\coord) -- ++(-\ltick,0,0) -- ++(0,\ltick,0)
node [start,above right] {\coord};
}
\end{scope}
%%% figure
\filldraw [opacity=.33,green] (\x2triangle,0,0) -- (0,\y2triangle,0)
-- (0,0,\z2triangle) -- cycle;
\end{tikzpicture}
\label{fig:bla bla}
\end{figure}
\end{document}
答案1
应该是at start
而不是start
:
\documentclass[tikz,border=10pt,multi]{standalone}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{70}{115}
\begin{tikzpicture}[tdplot_main_coords]
\def\laxis{7}
\def\xtriangle{3}
\def\ytriangle{4}
\def\ztriangle{5}
\def\ltick{.2}
%%% axes
\draw [->] (0,0,0) -- (\laxis,0,0) node [below] {July 15};
\draw [->] (0,0,0) -- (0,\laxis,0) node [right] {July 29};
\draw [->] (0,0,0) -- (0,0,\laxis) node [left] {August 12};
%%% axes ticks
\pgfmathtruncatemacro{\nticks}{floor(\laxis)-1}
\begin{scope}[
help lines,
every node/.style={inner sep=1pt,text=black}
]
\foreach \coord in {1,...,\nticks} {
\draw (\coord,\ltick,0) -- ++(0,-\ltick,0) -- ++(0,0,\ltick)
node [pos=1,left] {\coord};
\draw (\ltick,\coord,0) -- ++(-\ltick,0,0) -- ++(0,0,\ltick)
node [pos=1,right] {\coord};
\draw (\ltick,0,\coord) -- ++(-\ltick,0,0) -- ++(0,\ltick,0)
node [at start,above right] {\coord};
}
\end{scope}
%%% figure
\filldraw [opacity=.33,red] (\xtriangle,0,0) -- (0,\ytriangle,0)
-- (0,0,\ztriangle) -- cycle;
\def\x2triangle{6}
\def\y2triangle{5}
\def\z2triangle{2}
\def\ltick{.2}
\begin{scope}[
help lines,
every node/.style={inner sep=1pt,text=black}
]
\foreach \coord in {1,...,\nticks} {
\draw (\coord,\ltick,0) -- ++(0,-\ltick,0) -- ++(0,0,\ltick)
node [pos=1,left] {\coord};
\draw (\ltick,\coord,0) -- ++(-\ltick,0,0) -- ++(0,0,\ltick)
node [pos=1,right] {\coord};
\draw (\ltick,0,\coord) -- ++(-\ltick,0,0) -- ++(0,\ltick,0)
node [at start,above right] {\coord};
}
\end{scope}
%%% figure
\filldraw [opacity=.33,green] (\x2triangle,0,0) -- (0,\y2triangle,0)
-- (0,0,\z2triangle) -- cycle;
\end{tikzpicture}
\end{document}