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)

13
votes
1answer
3k views

Calligraphic logo in tikz

Yep, it's that time again. I want to design a calligraphic logo and my obvious choice as LaTeX enthousiast is TikZ as implementation. Only, I lack the proper skills to do so and need some inspiration. ...
6
votes
1answer
784 views

position background image with \SetBgAnchor

I want to print an A4 page on B4 stock, with crop marks and bleeding square grid. I use memoir for crop marks, and background with TikZ for the grid. I would like the (0,0) in TikZ be placed at the ...
5
votes
1answer
4k views

How to fix the space between each x ticks in a pgfplot?

I want to plot some data using pgfplot. Here is what I got for now: \begin{tikzpicture} \begin{axis}[ xlabel=X, xmin = 0, xtick = {1,2,3,4,8}, ylabel=Y, enlargelimits=false ] \addplot ...
4
votes
1answer
978 views

TikZ semi transparent contiguous shapes with no gaps

Short Question: The short question can be stated as follows: Is there a way to perfectly align filled (but possibly not drawn) shapes that completely cover contiguous areas? Consider the MWE: \...
5
votes
3answers
598 views

Add a node above matrix column

I am trying to put symbols above and the columns of a matrix and also to the left of its rows. The following working example is basically, what I want, except, that the symbols are within the brackets....
5
votes
2answers
2k views

LaTeX, qtree: Color and Animation for branches of a graph tree

I'm trying to do a beamer animation of a parse of a simple binary branching tree. I'd like to either use different colored branches and node labels to code the different steps of the parser and/or ...
16
votes
2answers
5k views

How to select a finite number of samples from the file when plotting using pgfplot

I have a datafile containing thousands of points of which I need to plot only the first 100 points. How to do this using pgfplots? I tried the following with no effect. \begin{axis}[
xlabel=k,
ylabel=...
3
votes
1answer
2k views

how to plot a sequence of numbers (not co-ordinates as such) using pgfplots

I have a data file containing a sequence of numbers, to be plotted against integers starting from 1. So the x co-ordinate is the row number of the data in the file. How to plot this data using ...
4
votes
2answers
3k views

Options to change a path on a elegant way in TikZ

I'm building a figure of a finite state automate. However the edge of F to C seems to make the image less readable. Using bend options doesn't solve the problem. is there a way to solve this problem? ...
6
votes
1answer
626 views

A looping edge with “shorten >=…” that is symmetrical and points toward the node

The "shorten >=" option in TikZ causes a change in the shape of the Bezier curve. With a looping edge for example, it makes the loop asymmetrical (node A in the picture). I could make it symmetrical ...
6
votes
1answer
1k views

Horizontal bar-charts in PGFPlots: “point meta” messes with alignment

I'm drawing a rather unusual bar-chart to display the results of a small survey. The axis of the chart extends in both the negative and the positive domain. However, there is no zero and all values ...
7
votes
3answers
5k views

Configuring node placement and width with TikZ, overlapping nodes

I've created a simple feedback structure but cannot cause the utmost right block not to overlap with the circle. I've tried altering this block's width with minimum width and text width, but it doesn'...
11
votes
1answer
535 views

Branching lines in TikZ without antialiasing/subpixel artifact?

Is there a way to properly branch a line into several lines in TikZ? Simply adding paths creates a darkening artifact where the paths overlap: \begin{tikzpicture}[very thin,-stealth] \draw (-1, 0) -...
25
votes
6answers
24k views

How to establish node-anchor-like points on a (tikz) rectangle path (is there a better method than the one described)?

Background and desired functionality Rectangles can be drawn with tikz in a number of ways, one way of doing so is to define a rectangle node as follows: \node (rectangle) [draw, rectangle] {A ...
14
votes
2answers
11k views

How to display labels on points of a tikz plot

I'm creating a \begin{tikzpicture} - unclear if I'm working with tike or pgf or whatever honestly, but I have my data displaying perfectly using \addplot[my options] coordinates { .. my data here }. ...
3
votes
1answer
256 views

How to align macros to correct order in TikZ matrix?

How to fix the broken placement of macros in matrix? \documentclass{article} \usepackage{tikz} \begin{document} \newcommand{\macroA}{ \begin{tikzpicture} \node[minimum height=1.5cm,minimum width=1....
22
votes
4answers
2k views

How to draw arrows from cell to cell at the borders of a table

How can I draw arrows from cell to cell at the borders of a table? More precisely I'd like to get something like this: It would be nice to have a solution using TikZ. Edit: Since I have other ...
8
votes
2answers
1k views

Nested foreach inside a TikZ matrix for both rows and columns

I'm trying to create a matrix using nested \foreach loops. I tried following the example I found in a previous question, but I keep getting errors. Here is the code I tried to run: \documentclass{...
10
votes
2answers
3k views

Is it possible to have a Bézier curve with 3 control points in TikZ?

In TikZ, it is possible to draw a Bézier curve of degree 3 with 2 control points p0, p1, p2, and p3 as follows: \draw(p0)..controls (p1) and (p2)..(p3); I am wondering whether there is a way to ...
8
votes
1answer
733 views

Access mdframed node coordinates with TikZ?

Is it possible to get a (breakable) frame like this with mdframed? Or as a more general question. Can one access the coordinates of the frame that is drawn with TikZ? With a pagebreak in it: I ...
24
votes
5answers
3k views

Lower and upper Riemann sums

I am trying to create a few images for educational purposes. Therefore I need to be able to illustrate the area under various functions, using lower and upper riemann sums (rectangles) Reason for not ...
14
votes
2answers
2k views

Draft mode in Tikz externalize hides graphics, but not without externalize

Maybe this is expected behaviour, but it's not documented in the manual, and it certainly surprised me. When you use the draft class option and use the tikz external library, all Tikz pictures are ...
11
votes
1answer
1k views

How to use \pgftransformcm and \inheritsavedanchors in a new shape (batman) from an ellipse

I try to make this shape but I have several problem. First to place the logo inside the ellipse, I used \pgftransformcm{1}{0}{0}{1}{\centerpoint} perhaps there is a better solution. I need to use \...
30
votes
3answers
7k views

Using TikZ, how to draw an elliptical arc starting from point A to point B with the origin as its center where both radii are given?

I am new to TikZ and reading its manual now. For the sake of exercises, I want to draw Batman's logo as follows: Using TikZ, how to draw an elliptical arc starting from point A to point B with the ...
20
votes
2answers
2k views

Proper nesting of tikzpicture environments: Reset all PGF values to their defaults

Sometimes, nesting tikzpicture environments seems inevitable, e.g., if you want a node to contain a TikZ picture on its own. (Is it?) However, nesting tikzpicture environments is problematic, also ...
7
votes
1answer
2k views

How to typeset a TikZ picture inside a node?

The contents of a node are drawn in text mode. Is there a way, short of introducing a tikzpicture environment, to draw a picture inside a node? Nesting tikzpicture environments is problematic, also ...
2
votes
1answer
418 views

TikZ does not use square coordinates but polar one, how to change it in order to use Cartesian coordinates?

Consider the following: \begin{tikzpicture}[thick,scale=0.8] \node (v0) at (0,0) [label=right:$\emptyset$] {}; \node (v1) at (40:-2) [label=right:$v_1$] {}; \node (v2) at (70:-1.6) [label=...
34
votes
2answers
10k views

How to draw a poset Hasse Diagram using TikZ?

I need to draw an Hasse Diagram using LaTeX. TikZ is the solution I would like to use. I tried with a simple structure involving trees but obviously when I need to join two nodes, it is not possible. ...
6
votes
1answer
281 views

Usage of a saved dimension in another saved dimension in a \pgfdeclareshape command

I have a question about \saveddimen usage inside of a \pgfdeclareshape command. My code is as follows: \documentclass{article} \usepackage{tikz} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \...
7
votes
2answers
1k views

Figures in Latex: TikZ vs. eps

I usually use TikZ to generate graphics in LaTeX, but a new coauthor suggested to use Inkscape and EPS files for our graphics. He thinks that we should avoid using additional packages. I never thought ...
8
votes
3answers
876 views

How to create integer labels on TikZ grid when we don't know the grid size at compile time?

I want to put integer labels on the grid. The grid size depends on the image loaded. The real scenario is to vectorize a JPG image but I need a grid label for navigation as follows \documentclass{...
7
votes
5answers
3k views

TikZ Node with multiple shapes

My use case is drawing a ticked box in line with normal text like this: "Hello ☒ World." (unicode example, your mileage may vary). One solution I managed to come up with is the following rather ...
5
votes
1answer
511 views

How to connect different own TikZ macros together + default names of node

I will ask you for solution about a little bit more complex problem. Maybe it isn't so hard as it seems to be but, for me it is hard one. Let's say that i want to create four own macros \objecta, \...
4
votes
1answer
1k views

Can't find TikZ library calc

I've been googling for some time now, and can't find the manual for the TikZ library calc. All I see is people using it. Where can I find the manual or some info? Is it the same as the LaTeX package ...
21
votes
2answers
9k views

What is the preferred way of defining a TikZ constant?

I'm drawing a TikZ figure and am going to need a couple of constant that I could easily change between compilations, e.g. a main radius, a proportion, a number of lines, etc. What is the preferred way ...
7
votes
1answer
608 views

What does the colon in Tikz coordinates mean?

\draw (0,0) -- (60:.75cm) arc (60:180:.75cm); What does the colon in (60:.75cm) mean? Normally, I'd define a normal point there.
3
votes
2answers
2k views

latex code for graphing rational function

I've seen in TikZ and pgf Manual for version 1.18 a code for graphing some functions but it does not provide an example for a rational function. Can someone help me graph $x+\frac{1}{x}$?
3
votes
1answer
576 views

tabular as matrix

I have the attached figure and I need to have arrows from the entries of the table on the right-hand-side (one which says Dimensions List DL) to nodes of the tree. I think the best way to do this is ...
6
votes
1answer
906 views

How to “fix baselines” in tikz nodes?

I want to define nodes which are shapes with some text in it using \ce{} from the mhchem package. How would I go around ensuring the baselines are the same between nodes, right now it shifts if I use ...
7
votes
2answers
1k views

How can I draw irregular shading area with tikz?

How can I draw with tikz the irregular shaded area and (similarly?) the irregular frame around nodes like the ones in the image?
10
votes
2answers
4k views

Is it possible to apply a style to all (tikz) rectangles?

I know that it's possible to apply styling to all tikz nodes or paths, as in the following example: \tikzset{ every node/.style={ text=red }, every path/.style={ color=...
5
votes
3answers
701 views

How to scale and clip a path at the same time?

Again, i started a question here, and i found the solution. But i think this method maybe useful for others. The problem: i exported the TikZ code of one path from Inkscape; then, i wanted to use it ...
6
votes
1answer
455 views

Pass options to the scope that is internally created by preaction

In the reply to this question on shadows, it was suggested to use the backgrounds library so that the shadow of one object doesn't overlap another object drawn previously. If I understand the ...
4
votes
3answers
1k views

Tikz,PGFplots: drawing in node's cs placed on plot

I'm trying to place some arrows which should be placed alongside the graphs. I place nodes on the graph using node[pos=0.2,above] (point1) {} Then I want to draw in that coordinate system \draw [-...
25
votes
2answers
3k views

Is there a way to compile tikz graphics outside a document?

As my document grows, so does the number of drawings. I am using PGF/TikZ and each drawing is what is enclosed between \begin{tikzpicture} and \end{tikzpicture}. Every time the document is compiled, ...
3
votes
1answer
497 views

Grid customized

I would like to build a grid such as the figure shown below where each grid point is surrounded by some of the two curves that describe below. First curve: an outline around the point forming a ...
6
votes
1answer
2k views

TikZ: Large arrow tips at the end of smooth curves

I have problems with adding a large arrow tip to smooth curves. It works perfect with straight lines, but as soon as I use the edge command, the arrow tips are added to the beginning of the curve ...
40
votes
4answers
7k views

How can I draw an arc from point A -> B on a 3D sphere in TikZ?

I'm basing myself on http://www.texample.net/tikz/examples/spherical-and-cartesian-grids/ and now I need to add a arc from point P to Q. What I was able to get so far: \begin{tikzpicture}[scale=1,...
6
votes
3answers
2k views

tikz connection label and node distance

Is it possible to have tikz automatically determining the distance between two nodes based on a third node used to connect them? For instance, in the following picture the arrow used to connect the ...
11
votes
4answers
1k views

Tikz, tangent between two circles

I am trying to create the image below Here is my code \documentclass[10pt,a4paper]{article} \usepackage{tikz,tkz-euclide} \begin{document} \center \begin{tikzpicture} \tkzDefPoint(0,0){O} \...