Graphics, Figures & Tablestikz does not show arc

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
paulosousa
Posts: 90
Joined: Sun Jun 24, 2012 8:48 pm

tikz does not show arc

Post by paulosousa »

Hello all,
need some assistance since the arc I need the angle ABC, noted x, does not show. What it's wrong?

Code: Select all

\definecolor{qqqqff}{rgb}{0.,0.,1.}

\begin{tikzpicture}[scale=0.70,line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\clip(0.5,0.175) rectangle (9.5,5.5);
\fill(1.,5.) -- (1.,1.) -- (5.,1.) -- (9.,1.) -- cycle;
\draw [shift={(9.,1.)},color=blue,fill=blue,fill opacity=0.1] (0,0) -- (153.44:0.6) arc (153.44:180.:0.6) -- cycle;
\fill[color=qqqqff,fill=qqqqff,fill opacity=0.95] (1.,5.) -- (5.,3.) -- (5.,1.) -- (1.,1.) -- cycle;
\fill[color=white,fill=white,fill opacity=1] (5.,1.) -- (9.,1.) -- (5.,3.) -- cycle;
\draw (1.,5.)-- (1.,1.);
\draw (1.,1.)-- (5.,1.);
\draw (5.,1.)-- (9.,1.);
\draw (9.,1.)-- (1.,5.);
\draw (5.,3.)-- (5.,1.);
\draw (6.80,2.60) node[anchor=north west] {\scriptsize $2$};
\draw (4.65,0.65) node[anchor=north west] {\scriptsize $4$};
\draw [thick, ->, >=stealth,line width=0.4pt] (5.20,0.30) -- (9.03,0.30);
\draw [thick, ->, >=stealth,line width=0.4pt] (4.74,0.30) -- (0.95,0.30);
\draw [color=qqqqff] (1.,5.)-- (5.,3.);
\draw [color=qqqqff] (5.,3.)-- (5.,1.);
\draw [color=qqqqff] (5.,1.)-- (1.,1.);
\draw [color=qqqqff] (1.,1.)-- (1.,5.);
\begin{scriptsize}
\draw [fill=qqqqff] (1.,1.) circle (0.5pt);
\draw[color=qqqqff] (0.93,0.75) node {\scriptsize $A$};
\draw [fill=qqqqff] (9.,1.) circle (0.5pt);
\draw[color=qqqqff] (9.1,0.75) node {\scriptsize $B$};
\draw [fill=qqqqff] (1.,5.) circle (0.5pt);
\draw[color=qqqqff] (0.99,5.24) node {\scriptsize $C$};
\draw [fill=qqqqff] (5.,1.) circle (0.5pt);
\draw[color=qqqqff] (5,0.75) node {\scriptsize $E$};
\draw [fill=qqqqff] (5.,3.) circle (0.5pt);
\draw[color=qqqqff] (5.0,3.2) node {\scriptsize $D$};
\draw[color=black] (7.5,1.35) node {\scriptsize $x$};
\end{scriptsize}
\end{tikzpicture}

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

tikz does not show arc

Post by cgnieder »

Can you complete your code snippet to a complete compilable document (a Infominimal working example), please?

Regards
site moderator & package author
paulosousa
Posts: 90
Joined: Sun Jun 24, 2012 8:48 pm

tikz does not show arc

Post by paulosousa »

Clemens,

Code: Select all

\documentclass[12pt, twoside, a4paper]{article}
\usepackage[portuguese]{babel}
\usepackage[applemac]{inputenc}
\usepackage[left=2.0cm,top=1.5cm,right=2.0cm,bottom=1.75cm]{geometry}
\usepackage{amsmath,amssymb,amsfonts,mathrsfs,textcomp,setspace,graphicx,color,xcolor,enumerate,environ,tabularx}
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{through,calc}
\usepackage{graphics, tikz, tkz-berge}

\definecolor{qqqqff}{rgb}{0.,0.,1.}

\begin{document}
\begin{tikzpicture}[scale=0.70,line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\clip(0.5,0.175) rectangle (9.5,5.5);
\fill(1.,5.) -- (1.,1.) -- (5.,1.) -- (9.,1.) -- cycle;
\draw [shift={(9.,1.)},color=blue,fill=blue,fill opacity=0.1] (0,0) -- (153.44:0.6) arc (153.44:180.:0.6) -- cycle;
\fill[color=qqqqff,fill=qqqqff,fill opacity=0.95] (1.,5.) -- (5.,3.) -- (5.,1.) -- (1.,1.) -- cycle;
\fill[color=white,fill=white,fill opacity=1] (5.,1.) -- (9.,1.) -- (5.,3.) -- cycle;
\draw (1.,5.)-- (1.,1.);
\draw (1.,1.)-- (5.,1.);
\draw (5.,1.)-- (9.,1.);
\draw (9.,1.)-- (1.,5.);
\draw (5.,3.)-- (5.,1.);
\draw (6.80,2.60) node[anchor=north west] {\scriptsize $2$};
\draw (4.65,0.65) node[anchor=north west] {\scriptsize $4$};
\draw [thick, ->, >=stealth,line width=0.4pt] (5.20,0.30) -- (9.03,0.30);
\draw [thick, ->, >=stealth,line width=0.4pt] (4.74,0.30) -- (0.95,0.30);
\draw [color=qqqqff] (1.,5.)-- (5.,3.);
\draw [color=qqqqff] (5.,3.)-- (5.,1.);
\draw [color=qqqqff] (5.,1.)-- (1.,1.);
\draw [color=qqqqff] (1.,1.)-- (1.,5.);
\begin{scriptsize}
\draw [fill=qqqqff] (1.,1.) circle (0.5pt);
\draw[color=qqqqff] (0.93,0.75) node {\scriptsize $A$};
\draw [fill=qqqqff] (9.,1.) circle (0.5pt);
\draw[color=qqqqff] (9.1,0.75) node {\scriptsize $B$};
\draw [fill=qqqqff] (1.,5.) circle (0.5pt);
\draw[color=qqqqff] (0.99,5.24) node {\scriptsize $C$};
\draw [fill=qqqqff] (5.,1.) circle (0.5pt);
\draw[color=qqqqff] (5,0.75) node {\scriptsize $E$};
\draw [fill=qqqqff] (5.,3.) circle (0.5pt);
\draw[color=qqqqff] (5.0,3.2) node {\scriptsize $D$};
\draw[color=black] (8,1.20) node {\scriptsize $x$};
\end{scriptsize}
\end{tikzpicture}
\end{document}
cgnieder wrote:Can you complete your code snippet to a complete compilable document (a Infominimal working example), please?

Regards
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

tikz does not show arc

Post by cgnieder »

You're painting over the arc. Change the order:

Code: Select all

\fill(1.,5.) -- (1.,1.) -- (5.,1.) -- (9.,1.) -- cycle;
\fill[color=qqqqff,fill=qqqqff,fill opacity=0.95] (1.,5.) -- (5.,3.) -- (5.,1.) -- (1.,1.) -- cycle;
\fill[color=white,fill=white,fill opacity=1] (5.,1.) -- (9.,1.) -- (5.,3.) -- cycle;
\draw [shift={(9.,1.)},color=blue,fill=blue,fill opacity=0.1] (0,0) -- (153.44:0.6) arc (153.44:180.:0.6) -- cycle;
Regards
site moderator & package author
paulosousa
Posts: 90
Joined: Sun Jun 24, 2012 8:48 pm

Re: tikz does not show arc

Post by paulosousa »

All perfect now, Clemens
Thanks a lot for your help.

Do you have any 'magic' solution to break very long lines in matlab?
http://latex-community.org/forum/viewto ... 47&t=27315
Post Reply