
私は tikzpicture を使用していくつかのデータ ポイントをプロットしています。データ ポイントの塗りつぶし色をデフォルトの青以外の色に設定しようとしていますが、何が間違っているのかわかりません。過去に値を変更するだけで色を変更したことは確かですfill
が、この場合は機能しません。
MWE を添付しました。誰かこれについて手伝ってもらえますか:
\documentclass[a4paper]{article}
\usepackage{amsmath}
\usepackage{times}
\usepackage{url}
\usepackage{latexsym}
\usepackage{booktabs}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{graphicx, subcaption}
\usepackage{multirow}
\usepackage{amsmath}
\usepackage{pgfplots, pgfplotstable}
\usepackage{caption}
\usepackage{rotating}
\usepackage{nicefrac}
\usepackage{subfig}
\usetikzlibrary{spy}
\usepackage{color,colortbl}
\begin{document}
\begin{figure*}
\centering
\begin{tikzpicture}
\begin{semilogyaxis}[
nodes near coords,
ylabel={time [s]},
enlargelimits=0.2,
log basis y=10,
]
\addplot+[
black,
fill=red,
only marks,
point meta=explicit symbolic,
visualization depends on=\thisrow{alignment} \as \alignment,
every node near coord/.append style={font=\tiny,anchor=\alignment}
]
table [
meta index=2
]{
x y label alignment
0.4 7.24 C-1 0
0.5 4.42 C-2 0
};
\end{semilogyaxis}
\end{tikzpicture}
\caption{Text}
\label{fig:a1}
\end{figure*}
\end{document}
答え1
軸全体のオプションの代わりにを設定する必要があります。とmark options
の両方をロードする必要はなく、 の互換性バージョンをオプションで設定する必要があります。 また、2回ロードしています。 今後は、 を生成してみてください。pgfplots
pgfplotstable
pgfplots
compat
amsmath
最小限問題を再現するために不要なパッケージをすべて削除した例です。
\documentclass[a4paper]{article}
\usepackage{pgfplotstable}
\pgfplotsset{compat=1.12}
\begin{document}
\begin{figure*}
\centering
\begin{tikzpicture}
\begin{semilogyaxis}[
nodes near coords,
ylabel={time [s]},
enlargelimits=0.2,
log basis y=10,
]
\addplot+[
black,
mark options={fill=red},
only marks,
point meta=explicit symbolic,
visualization depends on=\thisrow{alignment} \as \alignment,
every node near coord/.append style={font=\tiny,anchor=\alignment}
]
table [
meta index=2
]{
x y label alignment
0.4 7.24 C-1 0
0.5 4.42 C-2 0
};
\end{semilogyaxis}
\end{tikzpicture}
\caption{Text}
\label{fig:a1}
\end{figure*}
\end{document}