Articles of tikz pgf

How to draw curve inside a closed curve?

I want to draw the following diagram: I have limited idea about TikZ but I want to draw this picture with TikZ. I have tried to draw the figure but ultimately faied. My written code given here: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw (0,0) ellipse (49pt and 39pt); \draw (0,1) to [out=90,in=190](0,-1); \draw (0,1) to [out=180,in=195](0,-1); […]

Pattern in \addplot inherits dashed option from previous \draw

I want to fill the area between two curves with a pattern, let’s say horizontal line. Since I want some other dashed lines below these curves, I use \draw[dashed] and then \addplot[pattern=horizontal lines] (twice). I notice that the area is filled with two different pattern options, dashed and solid and the cause is the previous […]

beamer – Mark several pseudocode block and insert comments near it

I try to use the answer proposed to this question: Mark a pseudocode block and insert comments near it But when I try to use it with several block, it does not work as perfectly as with only one highlighted block: \documentclass{beamer} \usepackage{algorithm,algpseudocode} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{xcolor} \makeatletter % to change colors \newcommand{\fillcol}{green!20} \newcommand{\bordercol}{black} % code […]

Create custom colored PGFPlots ybar with consistent spacing

I am trying to create a ybar graph that has consistent spacing between a set of columns. I have obtained the color scheme I need in the following example, based off guidance from this question on here \documentclass{memoir} \usepackage[left=1.5in, right=1in, top=1in, bottom=1in, headsep=0.1in, head=0.4in, includehead, includefoot, marginparsep=0in, marginparwidth=0in,footskip=0.4in]{geometry} \usepackage{graphicx} \usepackage{pgfplots} \usepackage{xcolor} \pagecolor{black} \pgfplotsset{width=7cm,compat=1.5.1} \usepackage{siunitx} \sisetup{inter-unit-product={}\cdot{},sticky-per=true,multi-part-units=single,separate-uncertainty=true,list-units=single,range-units=single,detect-all,detect-weight=true,detect-inline-weight=math} […]

TikZ compiles in body, but not as command

Possible Duplicate: Problem with defining shortcuts for TikZ matrices. When I use the code below to draw a tikzpicture in the body of my document, it works just fine. However, when I define a command and try to use it, I get a Missing $ inserted error. \documentclass[11pt]{amsart} \usepackage{tikz} \usetikzlibrary{matrix, shapes, backgrounds} \newcommand{\matrixa}{ \begin{tikzpicture}[>=latex] \matrix […]

Declaring an arrow for chemical equilibrium (steady-state arrow)

I tried to create an steady state arrow with pgfarrowsdeclare and pgfsetinnerlinewidth which seems to have no effect, when placed in the arrow declaration. So the following code shows my solution, which is not handy at all. \documentclass[border=5mm]{standalone} \usepackage{tikz} \begin{document} \newdimen\arrowsize \pgfarrowsdeclare{mya}{mya}{% next two lines do not work as expected. % \pgfsetinnerlinewidth{3pt} %no effect here […]

tikzscale and histograms in pgfplots

Tikzscale is giving wrong results for histograms drawn in pgfplots. Histogram without scaling by tikzscale: Histogram after scaling: I have included a histogram from page 67 from pgfplots manual for version 1.7 in the MWE. The pgfplots.randn.dat file comes with the standard texlive-2012 distribution or can be downloaded from the given link. MWE \documentclass{report} \usepackage{filecontents,tikz} […]

Difficulty placing a dynamic fill command within a “\path let …” TikZ structure

I wanted to create a sequence of images that show a rhombus being folded. I’m able to do what I want, but the code is not very elegant. I wind up (needlessly?) repeating chunks of code to get the effect that I want. Here’s the code: \documentclass{article} \usepackage[svgnames]{xcolor} \usepackage[margin=0.35in]{geometry} \usepackage{tikz} \usepackage{tkz-euclide} \usetikzlibrary{calc} \usetikzlibrary{decorations} \tikzset{rhombus fill/.style={fill=blue!\number\numexpr30+#1\relax}, […]

Dashing one edge from parent in a tree: why does it work

This is related to the question How to make a connection in a tree with a dashed line?. Therein, it is asked how one can make one connection between a parent node and a child dashed. The final solution proposed is along the line of alternating the edge from parent[solid] and edge from parent[dashed], which […]

How to make some adjustments and centralize these graphs

These are the graphs I am trying to reproduce: This is what I’ve done: My problems are: How to make those arrows in each loops in the second graph. (If possible) How to decrease the letter’s size (P, dB and ids) in the firs graph. How to centralize what I’ve done in the same line. […]