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)

7
votes
3answers
188 views

Tikz: how to plot arcsec and arccos?

It is easy to plot arctan and arccot, but got inverse sec and csc functions, It seems difficult. Can anyone do it?
2
votes
0answers
28 views

How to draw revolved disk shape using TikZ?

Is there an elegant way to rotate this shape about the axis and draw in 3D? Ideally I would like to be able to draw a revolved view of this as 180 deg, 270 deg and the full revolution at 360 deg. ...
2
votes
0answers
73 views

Solid of revolution about arbitrary axis

I'd like to rotate the region between y=cos(x) and y=x^2 - 0.25*pi^2 about the line x=pi. How to do this? So far I have only managed to rotate around the x-axis: \documentclass[letterpaper]{article} ...
2
votes
0answers
18 views

Externalised pgfplots figure.eps gets rotated 180 degrees

I am externalizing some plots by pgfplots in .eps format by using these two sizes case1: width=0.55\textwidth height=0.40\textwidth case2: width=0.6\textwidth height=0.45\textwidth which give a ...
26
votes
6answers
1k views

Design of an asteroid belt in TikZ

How can I construct an asteroid belt in TikZ? That is my question: I get everything right, but I do not know how to make the asteroid belt. I have no code to add besides the preamble with TikZ ...
2
votes
0answers
56 views

How do I get a straight line in \begin{tikzpicture}[decoration=Koch snowflake]?

The following code \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{decorations.fractals} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}[scale=3,decoration=Koch snowflake] ...
4
votes
3answers
120 views

sketching simple arrows with different direction

I want to sketch this figure.. if you guide me to draw one of this arrows with direction i would be grateful..
9
votes
3answers
180 views

Citing TikZ and other packages

In some areas of maths, it is advised to cite mathematical and drawing software you use to make your computations and drawings. Since I draw in TikZ, I would like to know how officially cite the ...
5
votes
1answer
95 views

Looking for a special paper style for letters

I am looking for a special paper style. It should be a paper with a good looking background, so that I can write letters on it. Ideally, it should be something like the attached image. Some key ...
1
vote
1answer
63 views

Labeling sides and angles of a right triangle for an argument of the Pythagorean Theorem

I would like to draw a right triangle so that its sides are not vertical or horizontal. (No coordinate axes.) I would like the legs to be labeled a and b and the hypotenuse to be labeled c. I would ...
7
votes
2answers
2k views

CircuitTikZ - Combine Tripoles with resistors

I'm just learning how to use CircuitTikZ to draw circuits, and I am trying to draw a good looking BJT biasing circuit. But I am having making the resistors across from each other look even, and since ...
10
votes
4answers
504 views

Foreach loop between two lists

\documentclass{article} \usepackage{tikz} \def\firstlist{0,1,2} \def\secondlist{0,1,2} \newcommand{\testa}{ \foreach \x/\y in {\firstlist/\secondlist} { \draw(0,\x)--(1,\y); } } ...
10
votes
2answers
144 views

Plot 3D stacked squares with shadow

This is an image I draw with tools. But I need to draw it with Tikz. And The 3 squares in the middle, I need to make them looks like 3D stacked with shadow. And the fonts on it, like 'a1', 'a2', ... ...
34
votes
6answers
994 views

Drawing Hex Boards

I need to draw a Hex board. I would like to be able to mark each hexagon and mark the size. Being able to control the thickness of the lines would be nice, but it is not something I need to have. ...
3
votes
2answers
212 views

Curved cylinders in Tikz

I would like to draw this figure here using tikz. However I do not know how to draw curved cylinders in Tikz. Can someone give a hint with it? Thanks
1
vote
2answers
48 views

Making a probability tree using tikzpicture / forest

I want to create a probability tree using either tikzpicture or forest. I have experimented a little bit with both, but I'm running into some trouble with both of the programs. First, I have my code ...
5
votes
3answers
109 views

Marking a grid with x and other symbols in tikz

I am new to using tikz. I have the following grid: \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning} \usetikzlibrary{patterns} \usetikzlibrary{shapes} ...
3
votes
0answers
50 views

Is there an easy way to generate weighted vertices in graphs?

There are several ways to include edge weights in graphs, but what about node/vertex weights? I need each vertex to be labelled with a letter and weighted with a number; I cannot find code that does ...
5
votes
1answer
44 views

How label position and color can be modified in tikzpicture in posters?

I am working on a poster with fancytikzposter package, I cutted out the problematic part, it can be downloaded from here. I created a tikzpicture inside the poster and some problems occured: ...
9
votes
1answer
184 views

Is it possible to cut a tikzpicture in half if the picture is too long and display it on two pages?

I'm using tikz (tikzpicture to be precise) to make some "drawings" (trees). The problem is that my "drawing" is too long to fit on one single page (it's too long). I was wondering what was the best ...
1
vote
3answers
103 views

Fill and draw option

Is there a single option to set both the draw and the fill color of a TikZ node? Something like: \node[rectangle,drawandfill=red]{test}; The actual problem is the following: I have many adiacent ...
20
votes
4answers
637 views

Crop jpeg into circular tikz node

\documentclass[demo]{article} \usepackage{graphicx} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node[circle,draw,inner sep=2cm]{\includegraphics{myimage.jpg}}; \end{tikzpicture} ...
9
votes
3answers
221 views

How to tell TikZ to first compute and then display a variable?

I want TikZ to first compute and then display the value of a variable. The question is, for sake of simplicity, based on this concrete example from TeXample.net: \documentclass{article} ...
7
votes
2answers
235 views

Why is beamer+pstricks+preview no longer compatible now?

The following code is taken from Gonzalo Medina' answer here (click). At the time he posted the answer the code was compilable. \documentclass{beamer} \usepackage{pstricks-add} ...
3
votes
1answer
95 views

tikz ovelapping bars

The following code \documentclass[12pt,a4paper,onecolumn, openright]{report} \usepackage{pgfplots} \usepackage{tikz} \begin{document} \begin{figure} \centering \begin{tikzpicture} ...
7
votes
2answers
220 views

Trees with only leaves in TikZ

Following Roel's answer to How to write a tree with no (visible) root with TikZ? I attempted to visualise my Huffman-Code for "Tennessee", but it didn't turn out as I expected: My MWE: ...
2
votes
1answer
49 views

Drawing Graph of Markov Chain with “Patches” using Tikz

First time using Tikz. Haven't found any documentation on drawing graphs like these, so I have been reading other examples and trying to modify their code to fit my example. I am trying to reproduce ...
1
vote
2answers
127 views

sketching semicirles and horizontal lines

I want to sketch this parallel lines and semicircles between them sth like the attached figure... would you plz help me?
11
votes
3answers
192 views

How to improve on this “twolines” decoration?

I'm typesetting an article on graphical calculus in tensor categories in TikZ and I wanted to define a decoration that draws two parallel lines at the same time. Here is my first try: ...
5
votes
1answer
65 views

How to fix this problem with tikz knots and decorations?

Using the knots package, which is part of Andrew Stacey's spath3, one can draw beautiful paths that cross each other. However, there are problems when combining it with decorations: ...
8
votes
2answers
172 views

Tikz, decorations

I use tikz as a general purpose drawing package because of its flexibility etc... I need to draw some Feynman diagrams like these: I tried to draw arc like \begin{tikzpicture} \draw [decorate, ...
4
votes
1answer
783 views

Linebreak in ticks-labels

I'm using \symbolic y coords in a xbar-plot. Some of these coords are very long. There is a solution using nodes which is very ... hardcoded. And it would be nice to have it automated. How do I ...
11
votes
1answer
904 views

Automatic background coloring in listings using tikzmark

I am authoring Beamer presentations that feature numerous code listings, and I am required to highlight portions of code with semi-transparent balloons. Yet I've come up with a solution that uses a ...
3
votes
0answers
59 views

Node at tip/pinch of brace in Tikz

I'm trying to add some explanatory braces in my graphic, and find myself running into some minor difficulties/inconveniences. [Edit]: After being made aware that the main thrust of the question ...
1
vote
1answer
58 views

Drawing a brush stroke like outline

I'm trying to reproduce the following picture with TikZ: Which is basically a circle with a variable width outline (the red line in the pic) that looks like a brush stroke. Can someone kindly give ...
2
votes
1answer
95 views

Draw graphical model with many nodes

So I tried to follow the answer in http://stats.stackexchange.com/questions/16750/software-for-drawing-bayesian-networks-graphical-models with limited success. My problem is How do I incorporate ...
8
votes
1answer
181 views

Pascal's triangle in Tikz with symbols

I have a follow-up question to Pascal's triangle in tikz with row headers. Is it possible to produce Mark's solution with symbols in Pascal's triangle? So, I could create the same figure, but ...
2
votes
0answers
44 views

beamer: make a picture stay in the foreground

I am trying to write some style file for a poster framework, we can use. The header is almost ready: \setbeamertemplate{headline} { \begin{beamercolorbox}[ht=15cm]{headline} ...
6
votes
1answer
71 views

Arrow from brace to node

I would like to draw an arrow from the tip of a curly bracket to a node, but if I do the following, an extra arrow point is drawn just above the tip of the brace. \documentclass{article} ...
12
votes
1answer
2k views

Stacked barplots/groupplots with text labels in x-coordinate

I was trying to stack a groupplot, or was it grouping a stacked plot? However I was trying to get something like: The ybar stacked option works quite nice here. But when I try to adapt it to a ...
6
votes
1answer
73 views

plot legend : increase its area

So my question in general is what is the method to change the precise area of the rectangle used in pgf plots? Yes, to make it larger ... MWE: a typical bar chart ...
3
votes
3answers
127 views

Plotting functions and denoting equation on the figure

How can I plot the functions P=20-1/5*Q and P=5+1/9*Q so as to find the equilibrium point? The figure I need is like the following: Furthermore, how could I put the equation on each ...
9
votes
1answer
76 views

TikZ in Beamer: subscope does not inherit `visible on` from parent scope

In the MWE below, I define a macro \markxy that draws dashed lines from a point to the x and y axes to indicate the x/y coordinates. Since I don't want the dashed lines to be drawn over my other "more ...
8
votes
2answers
351 views

Picture indicating the fifth roots of unity

I would like to have the unit circle, centered at the origin, on the Cartesian plane drawn. The origin is to be marked with a dot and labeled "O" and five dots are to be drawn on the circle, one on ...
11
votes
2answers
219 views

Derivative of a tikz path?

I would like to draw curves that are smooth and have linear segments. These curves are to be used in the graph of one-dimensional functions, x(t). [To be used as position vs time graphs in writing ...
4
votes
1answer
86 views

What is the easiest way to accomplish textual tick labels in tikz?

Consider the following simple PV-diagram: The code below created it and the output is fine. I used kind of a workaround with an array to get the right tick labels on both of the axes. That works ...
35
votes
4answers
6k views

Draw mechanical springs in TikZ

Currently I am using the following path style to draw springs in TikZ \tikzstyle{spring}=[thick,decorate,decoration={zigzag,pre length=0.1cm,post length=0.1cm,segment length=6}] for example ...
3
votes
2answers
123 views

Optimized creation of text nodes

I have created a block diagram with several nodes with text and I need to optimize the node creation and hopefully use the \foreach construct to automate the creation of each node with its associated ...
3
votes
0answers
41 views

TikZ: Unexpected difference between \draw and — vs \path and edge

While modifying this answer for my own use, I encountered something unexpected. In my experience, using \draw (1) -- (2) is equivalent to \path (1) edge (2). However, adding the option to draw or ...
3
votes
1answer
53 views

Alter location of edge in graph in tikz

So I have the following: \begin{tikzpicture}[shorten >=1pt,node distance=1.75cm,thick] \node (A) {$A$}; \node (B) [below left of=A] {$B$}; \node (C) [below right of=A] ...