声明后改变节点颜色

声明后改变节点颜色

我尝试在使用声明节点后更改fill我的设置,但没有任何变化。有什么想法可以解决它吗?顺便说一句,下面是我的代码。node\node also

\documentclass[a4]{article}  % Comment this line out if you need a4paper
                                                  
%\documentclass[a4paper, 10pt, conference]{ieeeconf}      % Use this line for a4 paper

%\IEEEoverridecommandlockouts           % This command is only needed if % you want to use the \thanks command
                                                          
%\overrideIEEEmargins % Needed to meet printer requirements.

\usepackage{multirow}
\usepackage{svg}
\usepackage{animate}
\usepackage{lettrine}
\usepackage{standalone}
\usepackage{caption} 
\captionsetup[table]{skip=6pt}
\captionsetup[figure]{skip=6pt}
\usepackage{graphicx,float}
%\usepackage{tkz-graph}
\usepackage{tikz}
\usetikzlibrary{automata, positioning, arrows.meta,calc,cd,animations}
\usetikzlibrary{patterns}
\usetikzlibrary {shapes.geometric}
\usetikzlibrary{datavisualization}

%\usetikzlibrary{calc}
\tikzset{
->, % makes the edges directed
>=stealth, % makes the arrow heads bold
node distance=3cm, % specifies the minimum distance between two nodes. Change if necessary.
every state/.style={thick, fill=gray!10}, % sets the properties for each ’state’ node
initial text=$ $, % sets the text that appears on the start arrow
}
\usepackage[fleqn]{amsmath}
\usepackage{amssymb}
\usepackage{cite}
% \usepackage[maxbibnames=99,style=ieee, isbn=false,url=false,eprint=false]{biblatex}
% \def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
%     T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
% \addbibresource{MPC.bib}
\usepackage{lettrine}
\let\labelindent\relax
\usepackage{enumitem}
\usepackage{multicol}
\usepackage{pgfplots}
\makeatletter
\newenvironment{customlegend}[1][]{%
    \begingroup
    % inits/clears the lists (which might be populated from previous
    % axes):
    \pgfplots@init@cleared@structures
    \pgfplotsset{#1}%
}{%
    % draws the legend:
    \pgfplots@createlegend
    \endgroup
}%

% makes \addlegendimage available (typically only available within an
% axis environment):
\def\addlegendimage{\pgfplots@addlegendimage}
\makeatother
\usepackage{subfigure}
\usepackage[T1]{fontenc}
\usepackage{adjustbox}
\usepackage{hyperref}
\usepackage{caption}
\captionsetup{belowskip=0pt}
\usepackage{booktabs,makecell}

\title{ACC 2023 Presentation Figures}
\author{Mostafa Tavakkoli Anbarani}
\date{May 2023}

\begin{document}

\maketitle

\begin{figure}[t]
        \begin{adjustbox}{minipage=\textwidth,scale=0.5}
            \begin{tikzpicture}[node distance = 2cm, on grid,>={Stealth[inset=0pt,length=6pt,angle'=28,round]}
            ,state/.style={circle, draw, minimum size=1.5cm, thick, fill=gray!10}
            ,half_fill/.style n args={1}{path picture={
            \fill[#1] (path picture bounding box.center) -- (path picture bounding box.south)  arc [start angle=-60, delta angle=180, radius=1] -- cycle;
            }}]
            
            \node[state, initial, fill = red] at (3,0) (q1) {$q^1$};
            \node[state, fill = red] at (6,0) (q2) {$q^2$};
            \node also[fill= yellow] (q1);
            \end{tikzpicture}
        \end{adjustbox}
    \caption{}
    \label{filling-line}
\end{figure}
\end{document}

相关内容