Graphics, Figures & TablesCannot display the Figures in PDF because of errors

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
asmithb
Posts: 24
Joined: Tue Feb 23, 2021 12:04 pm

Cannot display the Figures in PDF because of errors

Post by asmithb »

Dear users,

I need your help regarding these figures. For some reason, I cannot display them in PDF, and the system gives me errors. I cannot figure out what the problems are. I had already printed out the PDF document, but for some reason, I am getting errors now. Moreover, if I write in document class "Standalone", I can display Figures 2 and 3 but not the others. Here I attach my whole code. Please let me know what the mistakes are because I have no clue. I also attach how the article should look like.

Code: Select all

\documentclass{article}
 
\usepackage{tikz, amsmath,spath3} 
 
\usetikzlibrary{decorations.shapes}
\usetikzlibrary{hobby}
\usetikzlibrary{calc}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{intersections}
 
\usepackage[font=normalsize,labelfont=bf]{caption}

\usetikzlibrary{patterns}
 
\begin{document}

\section{List of Figures}

\begin{figure}
    \centering
    \caption{Size of the Winset with Two Veto Players}
    \label{fig:two}

\begin{tikzpicture}


 
\begin{scope} [fill opacity = .4]
 
\draw (-8,5) rectangle (6,-4.5) ;

% name the paths:
\path[name path=A, draw, fill=green] (-4.5,0) circle (3) node(NA){};
\path[name path=C, draw, fill=red] (1.5,0) circle (4) node(NC){};

\begin{scope}[fill opacity=1]% punch out the intersecting area of circles A and C:
\clip (NA) circle (3);% half the line width smaller than the circle's radius
% to keep the circle's line (B) intact.
% (= 3cm - 0.2pt * 2.54cm/in / 72.27pt/in)
\fill[blue] (NC) circle (4);% same here for circle A

\end{scope}% end the scope to be able to draw something outside its clip area





\begin{scope}[fill opacity=1]% punch out the intersecting area of circles A and C:
\clip (NC) circle (4);% half the line width smaller than the circle's radius
% to keep the circle's line (B) intact.
% (= 3cm - 0.2pt * 2.54cm/in / 72.27pt/in)
\fill[white, dashed, postaction={pattern=north west lines}] (NA) circle (3);

%\fill[white] (NA) circle (3);% same here for circle A
\end{scope}% end the scope to be able to draw something outside its clip area

 
% get the intersection points between circles A and B:
\path[name intersections={of=A and C}];
\begin{scope}[fill opacity=0]% put some solid dots at the intersecting points:
\fill (intersection-2) circle (3pt) node[below=3pt]{SQ};
\end{scope}
 
\node at (-4,3.5) {\LARGE\textbf{A}};
\node at (3,4) {\LARGE\textbf{C}};
\end{scope}

% Point a
 \coordinate (a) at (-4.5,0);
 \fill (a) circle [radius=3pt];
 \node [below] at (a) {$A$}; 
 



% Point c
 \coordinate (c) at (1.5,0);
 \fill (c) circle [radius=3pt];
 \node [below] at (c) {$C$}; 

\draw (a) -- (c);  


% get the intersection points between circles A and B:
\path[name intersections={of=A and B}];
\begin{scope}[fill opacity=1]% put some solid dots at the intersecting points:
\fill (intersection-1) circle (3pt) node[above=3pt]{SQ1};
\end{scope}

% get the intersection points between circles A and B:
\path[name intersections={of=A and B}];
\begin{scope}[fill opacity=1]% put some solid dots at the intersecting points:
\fill (intersection-2) circle (3pt) node[below=3pt]{SQ2};
\end{scope}


\node at ([yshift=-7mm]  current bounding box.south)     
{
\begin{tabular}{r@{: }l r@{: }l}
$Green$ & Veto Player A Indifference Curve  & Pink& Veto Player C Indifference 
Curve &
$SQ& Status Quo &  $Dashed& Winset Area of A-C 

\end{tabular}


};


\end{tikzpicture}
\end{figure}




\begin{figure}
    \centering
    \caption{Smaller Size of the Winset after ideological differences have increased}
    \label{fig:my_label}

\begin{tikzpicture}


 
\begin{scope} [fill opacity = .4]
 
\draw (-8,5) rectangle (6.5,-4.5) ;

% name the paths:
\path[name path=A, draw, fill=green] (-4.5,0) circle (3) node(NA){};
\path[name path=C, draw, fill=red] (2.2,0) circle (4) node(NC){};

\begin{scope}[fill opacity=1]% punch out the intersecting area of circles A and C:
\clip (NA) circle (3);% half the line width smaller than the circle's radius
% to keep the circle's line (B) intact.
% (= 3cm - 0.2pt * 2.54cm/in / 72.27pt/in)
\fill[blue] (NC) circle (4);% same here for circle A

\end{scope}% end the scope to be able to draw something outside its clip area





\begin{scope}[fill opacity=1]% punch out the intersecting area of circles A and C:
\clip (NC) circle (4);% half the line width smaller than the circle's radius
% to keep the circle's line (B) intact.
% (= 3cm - 0.2pt * 2.54cm/in / 72.27pt/in)
\fill[white] (NA) circle (3);% same here for circle A
\end{scope}% end the scope to be able to draw something outside its clip area

 
% get the intersection points between circles A and B:
\path[name intersections={of=A and C}];
\begin{scope}[fill opacity=0]% put some solid dots at the intersecting points:
\fill (intersection-2) circle (3pt) node[below=3pt]{SQ};
\end{scope}
 
\node at (-4,3.5) {\LARGE\textbf{A}};
\node at (3,4.4) {\LARGE\textbf{C}};
\end{scope}

% Point a
 \coordinate (a) at (-4.5,0);
 \fill (a) circle [radius=3pt];
 \node [below] at (a) {$A$}; 
 



% Point c
 \coordinate (c) at (2.2,0);
 \fill (c) circle [radius=3pt];
 \node [below] at (c) {$C$}; 


\draw (a) -- (c);  


% get the intersection points between circles A and B:
\path[name intersections={of=A and B}];
\begin{scope}[fill opacity=1]% put some solid dots at the intersecting points:
\fill (intersection-1) circle (3pt) node[above=3pt]{SQ1};
\end{scope}

% get the intersection points between circles A and B:
\path[name intersections={of=A and B}];
\begin{scope}[fill opacity=1]% put some solid dots at the intersecting points:
\fill (intersection-2) circle (3pt) node[below=3pt]{SQ2};
\end{scope}


\node at ([yshift=-7mm]  current bounding box.south)     
{
\begin{tabular}{r@{: }l r@{: }l}
$Green$ & Veto Player A Indifference Curve  & Pink& Veto Player C Indifference Curve &
$SQ& Status Quo &  $White& Winset Area of A-C 

\end{tabular}


};

\end{tikzpicture}
\end{figure}


\begin{figure}
    \centering
    \caption{Size of the Winset after adding a Third Veto Player}
    \label{fig:three}

\begin{tikzpicture}


 
\begin{scope} [fill opacity = .4]
 
\draw (-8,5) rectangle (6,-4.5) ;

% name the paths:
\path[name path=A, draw, fill=green] (-4.5,0) circle (3) node(NA){};
\path[name path=B, draw, fill=blue] (-4.1,1.8) circle (2) node(NB){};
\path[name path=C, draw, fill=red] (1.5,0) circle (4) node(NC){};

\begin{scope}[fill opacity=1]% punch out the intersecting area of circles A and C:
\clip (NC) circle (4);% half the line width smaller than the circle's radius
% to keep the circle's line (B) intact.
% (= 3cm - 0.2pt * 2.54cm/in / 72.27pt/in)
\fill[pink] (NA) circle (3);% same here for circle A

\end{scope}% end the scope to be able to draw something outside its clip area




\begin{scope}[fill opacity=1]% punch out the intersecting area of circles A and C:
\clip (NC) circle (4);
\clip (NB) circle (2);% half the line width smaller than the circle's radius
% to keep the circle's line (B) intact.
% (= 3cm - 0.2pt * 2.54cm/in / 72.27pt/in)
\fill[white] (NA) circle (3);

%\fill[white] (NA) circle (3);% same here for circle A
\end{scope}% end the scope to be able to draw something outside its clip area

 
% get the intersection points between circles A and B:
\path[name intersections={of=A and C}];
\begin{scope}[fill opacity=0]% put some solid dots at the intersecting points:
\fill (intersection-2) circle (3pt) node[below=3pt]{SQ};
\end{scope}
 
\node at (-6.6,2.5) {\LARGE\textbf{A}};
\node at (-4,4.1) {\LARGE\textbf{B}};
\node at (3,4) {\LARGE\textbf{C}};
\end{scope}

% Point a
 \coordinate (a) at (-4.5,0);
 \fill (a) circle [radius=3pt];
 \node [below] at (a) {$A$}; 
 
% Point b
 \coordinate (b) at (-4.1,1.8);
 \fill (b) circle [radius=2pt];
 \node [below] at (b) {$B$}; 
 



% Point c
 \coordinate (c) at (1.5,0);
 \fill (c) circle [radius=3pt];
 \node [below] at (c) {$C$}; 

\draw (a) -- (b);  
\draw (a) -- (c);  
\draw (b) -- (c);  


% get the intersection points between circles A and B:
\path[name intersections={of=A and B}];
\begin{scope}[fill opacity=1]% put some solid dots at the intersecting points:
\fill (intersection-1) circle (3pt) node[above=3pt]{SQ1};
\end{scope}




\node at ([yshift=-7mm]  current bounding box.south)     
{
\begin{tabular}{r@{: }l r@{: }l}
$Green$ & Veto Player A Indifference Curve  & Pink& Veto Player C Indifference 
Curve & Blue& Veto Player B Indifference 
Curve &$SQ& Status Quo &  $White& Winset Area of A-C 

\end{tabular}


};


\end{tikzpicture}
\end{figure}



\begin{figure}
    \centering
    \caption{Absorption of Veto Player B}
    \label{fig:absorption}

\begin{tikzpicture}


 
\begin{scope} [fill opacity = .4]
 
\draw (-8,5) rectangle (6,-4.5) ;

% name the paths:
\path[name path=A, draw, fill=green] (-4.5,0) circle (3) node(NA){};
\path[name path=C, draw, fill=red] (1.5,0) circle (4) node(NC){};
\path[name path=B, draw, fill=blue] (-1,0) circle (2) node(NB){};

\begin{scope}[fill opacity=1]% punch out the intersecting area of circles A and C:
\clip (NA) circle (3);% half the line width smaller than the circle's radius
% to keep the circle's line (B) intact.
% (= 3cm - 0.2pt * 2.54cm/in / 72.27pt/in)
\fill[blue] (NB) circle (2);% same here for circle A

\end{scope}% end the scope to be able to draw something outside its clip area



\begin{scope}[fill opacity=1]% punch out the intersecting area of circles A and C:
\clip (NC) circle (4);% half the line width smaller than the circle's radius
% to keep the circle's line (B) intact.
% (= 3cm - 0.2pt * 2.54cm/in / 72.27pt/in)
\fill[blue] (NB) circle (2);% same here for circle A
\end{scope}% end the scope to be able to draw something outside its clip area

\begin{scope}[fill opacity=1]% punch out the intersecting area of circles A and C:
\clip (NC) circle (4);% half the line width smaller than the circle's radius
% to keep the circle's line (B) intact.
% (= 3cm - 0.2pt * 2.54cm/in / 72.27pt/in)
\fill[white] (NA) circle (3);% same here for circle A
\end{scope}% end the scope to be able to draw something outside its clip area

 
% get the intersection points between circles A and B:
\path[name intersections={of=A and C}];
\begin{scope}[fill opacity=0]% put some solid dots at the intersecting points:
\fill (intersection-2) circle (3pt) node[below=3pt]{SQ};
\end{scope}
 
\node at (-4,3.5) {\LARGE\textbf{A}};
\node at (-0.5,1) {\LARGE\textbf{B}};
\node at (3,4) {\LARGE\textbf{C}};
\end{scope}

% Point a
 \coordinate (a) at (-4.5,0);
 \fill (a) circle [radius=3pt];
 \node [below] at (a) {$A$}; 
 
 % Point b
 \coordinate (b) at (-1,0);
 \fill (b) circle [radius=3pt];
 \node [below] at (b) {$B$}; 


% Point c
 \coordinate (c) at (1.5,0);
 \fill (c) circle [radius=3pt];
 \node [below] at (c) {$C$}; 

\draw (a) -- (b); 
\draw (a) -- (c);  


% get the intersection points between circles A and B:
\path[name intersections={of=A and B}];
\begin{scope}[fill opacity=1]% put some solid dots at the intersecting points:
\fill (intersection-1) circle (3pt) node[above=3pt]{SQ1};
\end{scope}

% get the intersection points between circles A and B:
\path[name intersections={of=A and B}];
\begin{scope}[fill opacity=1]% put some solid dots at the intersecting points:
\fill (intersection-2) circle (3pt) node[below=3pt]{SQ2};
\end{scope}


\node at ([yshift=-7mm]  current bounding box.south)     
{
\begin{tabular}{r@{: }l r@{: }l}
$Green$ & Veto Player A Indifference Curve & $Blue& Veto Player B Indifference Curve & Pink& Veto Player C Indifference Curve &
$SQ& Status Quo &  $White& Winset Area of A-C = Winset Area of A-B-C 

\end{tabular}


};

\end{tikzpicture}

\end{figure}

\end{document}


List of Figures.pdf
(56.82 KiB) Downloaded 159 times
Last edited by asmithb on Tue Jun 01, 2021 10:55 am, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Cannot display the Figures in PDF because of errors

Post by Stefan Kottwitz »

Hi,

you need to load the pgfplots package:

Code: Select all

\usepackage{pgfplots}
With the standalone class, you cannot use \section and you cannot use figure environments, so they need to be removed in that case.

In general, you can read the error messages in the .log file to see what's the issue in case of errors.

Stefan
LaTeX.org admin
asmithb
Posts: 24
Joined: Tue Feb 23, 2021 12:04 pm

Cannot display the Figures in PDF because of errors

Post by asmithb »

I still do not understand why the command does not display the figures even after changing the document type to an article.
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Cannot display the Figures in PDF because of errors

Post by Ijon Tichy »

As
Stefan Kottwitz wrote: you need to load the pgfplots package:

Code: Select all

\usepackage{pgfplots}
You cannot use, e.g., \usepgfplotslibrary{fillbetween} without loading pgfplots. BTW: After loading pgfplots you should set option compat. See the pgfplots manual (currently section 2.2) for more information about how and why do so.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Cannot display the Figures in PDF because of errors

Post by Stefan Kottwitz »

You define paths A and C within a scope, I guess they are not usable out of the scope then. Perhaps define A, B, C before the scopes, so move those lines a bit up, each time.

And the path definition B is missing.

In lines 103, 200, around 300 and 400 there are more tabular columns as defined (4), or a line ending \\ is missing.

At some lines there's a semicolon ; missing at the end, after a \fill command.

Stefan
LaTeX.org admin
asmithb
Posts: 24
Joined: Tue Feb 23, 2021 12:04 pm

Cannot display the Figures in PDF because of errors

Post by asmithb »

Thank you very much!
Post Reply