TikZ is a higher-level drawing language built on top of the PGF graphics framework. For questions specifically about the PGF layer use {pgf-core} instead. Both tags are possible on the same question. The tag {diagrams} is also compatible with this tag.

learn more… | top users | synonyms (3)

3
votes
0answers
627 views

How to draw clipart icons in tikz? [closed]

Is there a way to draw clipart icons in tikz? Or is there a way to export them or should I use some other software for this purpose? I want to draw the following 5 icons:
4
votes
1answer
631 views

How to manually draw horizontal legend and place it correctly in tikz?

This is my tikz code to draw some plots. \documentclass{article} \usepackage{tikz,subfig} \begin{document} \begin{figure} \centering \subfloat[Iteration Domain for a Tile]{ ...
3
votes
2answers
708 views

How to ensure equal font sizes in all included TikZ/pgfplots figures?

I would like to have many tikzpictures in my document. Since each tikzpicture has its own size, I don't know how to manage the font size among all the pictures. Some of tikzpictures are of size ...
9
votes
2answers
305 views

Confusion regarding strings and numbers in tikz

I'm using a macro that uses \StrBetween from xstring It seems to be working great. However, when I try to use a value that it returns as a coordinate in a tikz picture, I get a confusing error. ...
7
votes
2answers
515 views

how can I fix my tikz circle to do what I want

Below is the minimal example of my code. I would like the dotted line to stay within the circle rather than overshooting it like it currently is but I am not able to figure out how this can be done. ...
5
votes
1answer
134 views

How to use tkiz point from two different nodes on separate axis?

I know I need to use the x from the counter node and the y from the rectangle node, but so far the right syntax has eluded me. Green indicates what I'm trying to fill, and red indicates the where the ...
3
votes
1answer
200 views

Switching from PDFLaTeX to XeLaTeX is messing with my pgftext coordinates

I'm working on a template for an automated report (using knitr). I created a title banner for my organization using TikZ; the last step to finish the branding was to switch to my organization's fonts. ...
10
votes
1answer
455 views

how to get x,y and z components of a coordinate?

I would like to be able to use x, y and z components of a defined coordinate in TikZ to reuse the values somewhere else in my code. For example, let's have something like, \coordinate (p1) at ...
8
votes
1answer
878 views

tikz and tables: node increases row height

I'm trying to add arrows to a table in my beamer presentation using the package tikz. Because I don't want the table to look different from the other tables in the presentation, I didn't use \matrix ...
2
votes
1answer
245 views

Need help making a data table from \plot function in Tikz

I want to be able to generate a list of points from a plot in Tikz, with an adjustable interval and range for the x-values. So basically something like this: ++++++++++++++ + + + ^ ...
24
votes
2answers
3k views

Dotted lines in TikZ with round dots

Well, the title explains all, I guess. Sorry if this is too simple for all the TikZ gurus here: but I want a dash pattern like "dotted" for drawning but with round dots and not the little squares. How ...
1
vote
0answers
35 views

Referencing nodes in matrix of nodes does not work in beamer [duplicate]

When using node coordinates in a matrix of nodes in the article document class, the following code works well and soes exactly what it is supopsed to: \documentclass{article} \usepackage{tikz} ...
12
votes
4answers
1k views

tikz apply fill between two lines

Simple question: Is it possible to fill the following shape: \documentclass[12pt]{article} \usepackage{tikz} \usetikzlibrary{decorations.pathmorphing} \begin{documet} \begin{tikzpicture} \draw ...
12
votes
2answers
400 views

Referring to tikz picture again in the same document

I couldn't really think of a reasonable title for this question; but anyhow, here goes: I saw a very interesting question and solution today here: \documentclass{article} \usepackage{tikz} ...
1
vote
1answer
408 views

connecting arrows between vertical and curved line

I would like to make a few alterations to the following figure: \documentclass[12pt]{article} \usepackage{tikz} \usetikzlibrary{snakes,arrows} \begin{document} \begin{tikzpicture} % draw the ground ...
18
votes
2answers
688 views

Can I place a caption inside of an image?

I've recently seen this the following image in this question: As I was looking for a way to create nice captions (without the "Figure:") for a beamer presentation, I wondered if it was possible to ...
2
votes
0answers
97 views

How to draw a smooth random blob with TikZ? [duplicate]

How can I draw a smooth, "natural" looking blob with TikZ? My approach \begin{tikzpicture} \draw [] (0,0)node[circle,draw,decorate,decoration={random steps,segment length=.3cm,amplitude=1cm},rounded ...
8
votes
1answer
1k views

How can I force the pgfplots coordinate system and the tikz coordinate system to match and why do they not match by default?

I plot a function with pgfplots and want to combine it with some simple \draw commands from tikz. But to my suprise the coordinate systems seem not to match. The rectangle drawn ranges from x=-10 up ...
6
votes
1answer
219 views

Determining tikz drawing style, depending on the values of two nested loop iterators

So the question is a tikz one! Assume that you are drawing things inside two nested foreach loops in tikz, and the iterator variables are \x and \y. What I'd like to obtain is to be able to specify a ...
7
votes
1answer
627 views

TikZ: draw objects in transparent objects (3d)

I want to draw a cuboid in another transparent cuboid with TikZ. Therefore I've created a \newcommand to draw a cuboid. \documentclass[11pt, halfparskip]{scrartcl} \usepackage{ucs} ...
4
votes
1answer
497 views

Setting default edges to be square (orthogonal) in a tree drawn with TikZ

I'm searching for a way to have orthogonal edges (only going horizontal and vertical) by default when I draw a tree. I can't seem to find a way to set this as the default style (without having to add ...
2
votes
0answers
101 views

Bounding box calculation in groupplots suddenly fails? [closed]

Suddenly some graphs changed in my documents. I have not the slightest idea what changed but as of today the bounding box calculation for some plots created in pgfplots is going haywire. My MWE looks ...
5
votes
1answer
515 views

Syntax for smoothing a coordinate plot with the foreach command

Currently implementing the solution of Curve synthesis - Adding two curves to get another one. I would like to smooth out the resulting curve. The present code: % red line \path[red,name path=one] ...
14
votes
2answers
1k views

TikZ coordinate calculations

I have very simple problem, and I also have a solution to the problem. But I am hoping for a better solution:) Consider the following code: \documentclass{article} \usepackage{tikz} ...
5
votes
1answer
211 views

Fill a node shape

I am trying to fill a custom shaped node but as can be observed in the example below the fill does not occur naturally rather it uses its default shape to fill. Any insights? ...
12
votes
2answers
494 views

How to detect if option provided via \tikzset

I would like to be able to detect if a particular option has been provided via a \tikzset and issue a message based on that. The MWE yields: But once the conditional works (just a comment for ...
7
votes
1answer
364 views

Drawing tree canopy

Is it possible to draw a tree canopy in latex, possibly with tikz. An example: So, on the left of this image you will see a bunch of trees, can these be re-created with tikz?
4
votes
1answer
308 views

Positioning node at end of line

The following code fails to do what I want: \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes.geometric,calc} \begin{document} \tikz{% \draw (0,0) -- (\textwidth, 0) node[draw, inner ...
3
votes
2answers
223 views

How do I define tikz styles with a xkeyval command?

I would like to write a command which allows the user to change tikz styles. My code goes like this: \documentclass{article} \usepackage{tikz,xkeyval} \makeatletter \def\DEFstyle{} ...
2
votes
1answer
1k views

how to get the size of a \pgfdeclareimage

Basically I want to use a TikZ node to frame a pgfimage, so later on, I will add more and connect them as I see fit. I have this: \pgfdeclareimage[width=10em]{image1}{images/image1} ...
6
votes
2answers
3k views

Overriding node draw style inherited from every node style messes up positioning

I have been trying to draw a tree with TikZ. All nodes should be circles, so I use the every node style. There are some additional labels on some nodes, which have to be exceptions. I have tried this: ...
6
votes
1answer
609 views

TikZ: Add decoration on a smooth coordinates plot

I would like to draw a smooth curve that I get from a coordinate plot after adding some additional decorations. So far I have. \begin{tikzpicture} \path [blue] plot [smooth] coordinates { (0.2,0.2) ...
5
votes
1answer
169 views

Adjusting box height to the document bottom

I made a command that prints a gray rectangle in my document. I can use this command typing: \notes{100}, where 100 is the vertical size of the box. \newcommand{\notes}[1]{ ...
5
votes
1answer
591 views

How to color the region between two curves with two different colors?

In the code below, I'm having two problems: \documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows} \begin{document} \begin{tikzpicture}[line cap=round,line join=round,>=triangle ...
4
votes
1answer
175 views

How to extend the table when text longer then the size of a cell is inserted?

\documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \begin{document} \tikzset{ table/.style={ matrix of nodes, row ...
4
votes
1answer
159 views

How to make these two graphs similar?

I want the left hand side of the following code's output to be exactly similar to the picture below. How can I do that? \documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows} ...
9
votes
3answers
955 views

how to make a cog/gear in LaTeX?

I was wondering what would be a good way to make this in LaTeX. Basically, what I want to do with this is use it as a chapter heading. So basically it will be something like this: cog chapter # ...
5
votes
1answer
364 views

How to color this region produced by tikz?

I'm using xelatex and I want to color the region enclosed by y=f(x), y=g(x) and the lines x=a and x=b in the code below (just like the picture below). How can I do that? \documentclass{article} ...
2
votes
2answers
890 views

How to horizontally top-align multiple \tikzpicture's without using \hspace?

The use case I'm having is the following: \documentclass{article} \usepackage{amsmath} \usepackage[showframe]{geometry} \usepackage{qtree} \begin{document} \Tree [.A B C [.D E ] ] \Tree [.F [.G H ...
4
votes
1answer
868 views

How to draw an additional line over an existing TikZ figure?

\documentclass[border=5mm] {standalone} \usepackage{pgfplots, pgfplotstable} \begin{document} \begin{tikzpicture} \pgfplotstableread{ % Read the data into a table macro Label First Second ...
11
votes
1answer
338 views

combining two diagrams with tikz and scale judiciously

I have the following code: \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.pathmorphing,calc} \begin{document} \usetikzlibrary{decorations.pathmorphing,calc} ...
2
votes
0answers
41 views

Increase the X length of a tikzpicture [duplicate]

This is the code that i'm using (Thanks to percusse in here): \documentclass[conference]{IEEEtran} \usepackage{lipsum} %<-- For dummy text \usepackage{pgfplots} \pgfplotsset{compat=1.7} ...
1
vote
0answers
146 views

Sieve of Eratosthenes [closed]

I have look at the answer from @AlainMatthes at Sieve of Eratosthenes in tikz where I have added the suggested extra code: Code \documentclass{article} \usepackage{tikz} \makeatletter ...
5
votes
2answers
256 views

TikZ, node with multiple lines around

I want to draw a circle node using tikz that has more than two lines around. I found this question: TikZ - multi-color double circle node with its very good accepted answer. Unfortunately, I have no ...
3
votes
1answer
286 views

Why is this TikZ pattern spilling outside the path it fills? [closed]

This: \documentclass{article} \usepackage{tikz} \usetikzlibrary{patterns} \begin{document} \begin{tikzpicture} \fill[pattern=horizontal lines] (0,0) -- (2,2) to[out=90,in=180] (4,5) -- (7,5) -- ...
11
votes
2answers
401 views

tikz - alter circular path with nodes

I am attempting to generate a circular path with nodes: \documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows} \begin{document} \begin{tikzpicture} \node (1) at (8,6) {A11}; \node (2) ...
3
votes
0answers
347 views

Drawing specific curves/planes [closed]

I want to submit a paper and the only thing that's left to do is to add some graphics. My deadline is on Wednesday/Thursday. What I want to do is some basic curve/plane drawings. Here is an image: ...
5
votes
1answer
869 views

Legend position & bad x ticks scale

I'm currently experimenting tikz-pgf, but facing some strong behaviour. How is it possible to have only 1 legend for a groupplot? Why is the scale 10^(-3) appearing below the first plot? Here is ...
7
votes
1answer
914 views

Axis ticks in radians in polar pgfplots

I am using the polar library with pgfplots to plot a graph like this: \begin{tikzpicture} \begin{polaraxis} \addplot[mark = none, domain = 0.4:12, samples = 600, data cs = polarrad]{sin(x)}; ...
2
votes
0answers
54 views

Problem in cropping the document in standalone package [duplicate]

I am trying to use standalone package along with tikzpicture. The resulting document is not cropped properly although I used the class option of crop=true. Could someone help me? Here is the code I ...