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.
19
votes
2answers
4k views
Pgfplots: how to fill the area under a curve with oblique lines (hatching) as a pattern?
I want to hatch the area under a curve (graph of a function) with oblique lines on an interval (to illustrate the function's integral on that interval). This can be done elegantly in gnuplot...
...
14
votes
5answers
2k views
Draw arc in tikz when center of circle is specified
It would be convenient sometimes to be able to draw an arc in tikz by specifying the initial/final angle, the radius and the center of the corresponding circle (the "natural" way an arc is defined) ...
22
votes
3answers
543 views
Properly aligning drawn lines between the corners of 2 rectangular nodes in TikZ?
When I draw a thick line from the corner of one box to the same corner of another, it doesn't attach properly. See the code and picture below:
\documentclass[a4paper, 11pt]{article}
...
19
votes
1answer
282 views
Is there a TikZ equivalent to the PSTricks \ncbar command?
Although I now use TikZ, every so often I find myself looking for very useful PSTricks commands which don't seem to exist in TikZ. The pst-node package has an \ncbar command which allows one to ...
15
votes
3answers
628 views
How to draw these diagrams (closed contours) using TikZ or PSTricks?
First, I must say I have no knowledge about PGF/TikZ nor PSTricks, but I would like to draw the following or similar closed contours using one of them or another adequate package. Where can I find the ...
10
votes
2answers
2k views
Precompiled preamble with TikZ/Externalize
I'm using the externalize capability of TikZ (external library) to speed up compilation of my TikZ pictures (as explained in Script to automate externalizing tikz graphics).
In addition, I would like ...
15
votes
1answer
238 views
TikZ: Thick curve segment in a curve
Is it possible to draw thick curve between (2,2) (4,3). Remaining portion must be thin.
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw [blue] plot [smooth] ...
11
votes
4answers
2k views
Modular arithmetic on node names in TikZ?
Say I have a bunch of nodes I've already created in TikZ---maybe v0, v1, ..., vn-1. I'd like to connect certain of these nodes in a systematic way, by doing arithmetic on the indices, ideally mod n. ...
8
votes
1answer
595 views
How can I mix an “ybar” and an “ybar stacked” with pgfplots?
I tried a while to create that kind of chart with ybar but it's a mix between "ybar stacked" and "ybar". How can I do that?
I tried this way but with no great results:
\begin{tikzpicture}
...
8
votes
1answer
790 views
Arrows and nodes in TikZ
I wish to draw arrows not necessarily at the end of the line, nor in the middle. I would also like to write a node directly above (or below, or to the right, ...) the arrow.
I saw this question, but ...
18
votes
1answer
778 views
'Poster' fountain pen nib style text
This question led to a new package:
spath3
(Technically, this question led to a subpackage of the spath3 package; the spath3 package provides some foundations on which a TikZ library ...
16
votes
2answers
504 views
Tikz: joining points on a circle
I have the following figure
I would like to draw portions of circles between some of the red points. More explicitly, I would like to go from ac1 to ab1 and then to ac2 following circle A, then go ...
15
votes
3answers
263 views
How can I set the tikz label anchor explicitly?
I want to add a label to a node, but "inside" the node. Something like this:
The manual seems to indicate it might be possible, although no actual key is named.
The ... anchor point for the ...
12
votes
2answers
926 views
How to decrease the size of single node in mindmap?
In tikz's mindmap, I want to change the concept size for individual parents or children (not the entire system). It is simply possible to increase the size of a child node, by introducing minimum size ...
12
votes
5answers
396 views
Combining |- and !.5! in TikZ
How do I combine the !.5! operator with the -| operator?
I want a node that has x-coordinate equal to the average of x coordinates of nodes A and B, and a y-coordinate equal to the average the y ...
11
votes
3answers
2k views
Large braces over several items in an itemize with text by the brace
This question is related to this question: Adding large brace next to body text, but is not a duplicate.
I have an itemize in a beamer presentation. I want to put a brace over some of these items. So ...
9
votes
1answer
186 views
How to fit ellipse into another object - using intersections and calc library
I would like to ask, how to place ellipse into any object, so that the length of the main arm is defined by line1 (point A, B) in my code:
calculate the coordinates of the ellipse midpoint
rotation ...
8
votes
4answers
1k views
Programming in TikZ
How do I write a macro that will return a path or a coordinate?
Here's an example:
\documentclass[border=2em]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
% \circleByPoint{centre}{point} ...
8
votes
2answers
2k views
Drawing arrow heads without the tails in TikZ?
I have an ellipse in a TikZ diagram and I would like to indicate a direction using an arrow head, but do not wish to draw the path leading up to the arrow head.
I currently have
\draw[->] (0,2) ...
20
votes
2answers
2k views
TikZ: multiple decorations on a path.
I would like to draw a squiggly line with an arrow somewhere in the middle of it. TikZ has a pathmorphing decoration that draws a squiggly line and a markings decoration to place an arrow tip. So a ...
16
votes
2answers
1k views
tikz: a big box with fixed width containing smaller boxes
I want to render with tikz something like :
The surrounding big box should behave somehow like a minipage : the width is fixed, and the height should grow if we add sufficiently small boxes inside. ...
13
votes
1answer
514 views
Drawing relationships between elements of a database
I am looking into a feasible way of drawing relationships between Elements from a database. An example: Element x is related to Element Y via the Role "sister".
Relationships exist in the form 1:1, ...
13
votes
3answers
695 views
Using opacity in TikZ makes the entire page become “more coarse” when printed
In my document, some of the figures uses opacity. In the PDF viewer, everything looks fine, but when I print the document, the pages in which these figures appear become more "coarse"; the text looks ...
10
votes
2answers
965 views
Coordinates of intersections
In axis environment I have a curve and a line intersecting it. How can I get components of intersection-1, intersection-2 etc. in axis units?
\documentclass{minimal}
\usepackage{pgfplots}
...
9
votes
2answers
895 views
Which package can easily write a graph, as an arbitrary curve or area, just for indication
Which package can easily write a graph, as an arbitrary curve or area, just for indication? The circle and ellipse don't be considered for their particular shape. TIKZ's BƩzier curve is too ...
8
votes
2answers
409 views
Compute the x distance between two nodes
Is there a way to define a macro which would evaluate to the x part of the distance between two nodes? I know there are the point registers \p and the correspoding \x commands, but I find them rather ...
7
votes
4answers
912 views
How can I set the background color of the rows and columns of a matrix node in Tikz?
I have a matrix where some cells have nodes while others don't, with rows and columns of varying size depending on the biggest nodes in them. In this matrix, I would like to have the background of ...
5
votes
1answer
293 views
Use a loop to generate a list for another (foreach) loop
Is it possible to use a loop to generate a list for a foreach loop? More specifically I want the following:
Consider the following answer to a question I asked some time ago: ...
4
votes
1answer
1k views
Non-linear curve fitting with gnuplot
I am trying to use gnuplot with pgfplots in TexShop, following on from an example by Martin H in the comments here.
I can get the data points in OK, and plot them but the fit (red line) does not seem ...
3
votes
3answers
237 views
How to submit a set of tikz command with pgfkeys?
I would like to send a serie of tikz keys to a tikz path with the pgfkeys interface. I succeeded with the following code but is there a simpler way to do that ? Can I do the same thing with something ...
8
votes
1answer
744 views
Foreach inside a TikZ matrix
Consider this MWE:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
\matrix [matrix of nodes] {
a \\
b \\
c \\
};
\end{tikzpicture}
...
7
votes
2answers
689 views
Tree-like diagram (flow chart?) showing selection of scientific papers when reviewing
I know the title I came up with is not self-explanatory, but I will show straight on some real life examples:
Part 1, Question 1:
Which package(s) is(are) closely suited for such diagrams? I ...
6
votes
1answer
426 views
Is it possible to change the color of a single bar when the bar plot is based on symbolic values?
I am beginner in LaTeX, trying to use it for industrial documents. I wonder if there is a way to change the color of only one bar of the plot below, ie "TestDetails", to illustrate it is a local macro ...
5
votes
1answer
3k views
How to label a path drawn using tikz with \draw plot?
Is there any workaround to use [pos=] or [midway] option in a node following a "plot" to annotate the path? The following minimal example will have the node text missing:
\documentclass{article}
...
4
votes
1answer
1k views
Use TikZ to draw frontpage
I'm not that familiar with TikZ and I want to use it for designing by front page. I want a blue bar in the top, where some text is centered in the bar. Like following (how do I center the text without ...
1
vote
1answer
607 views
Using Macro Defined Lists in TikZ/PGFplots
I want to be able to use a macro to specify a list (it is a constant list, i.e. will not change throughout the document) and use this macro rather than hard code the list contents in the TikZ/PGFplots ...
13
votes
1answer
528 views
How to fix TikZ corners in 3D
Am trying to draw a simple rectangle and there seems to be minor issue with two of the endpoints (f and d in the following). I tried line cap=rect as suggested by Bad intersection of lines in TikZ but ...
8
votes
2answers
750 views
Expandable Nested Boxes with TikZ
Could someone please post a minimal tikz example to draw this:
I am currently doing this with nested tables, but would like to see how it can be done with tikz.
The nodes would ideally have a ...
7
votes
2answers
1k views
Transparency in tikz, preview package and xelatex
Is it possible to have transparency in a tikz picture while using the preview package and compiling with xelatex?
The following mwe compiles without warnings/errors under both xelatex and pdflatex ...
7
votes
1answer
739 views
Shrinking text to the width of a node within a tikzpicture
I would like to be able to scale text to the width of a TikZ node.
Using \widthof within tikzpicture as a starting point, I've arrived at somewhat of a solution, except it has incorrect spacing, and ...
6
votes
2answers
2k views
Feynman Diagrams with tikz
I am trying to find some example code for some very simple Feynman diagrams. Something similar to any or all of the pictures below
I was able to find some example code on texample.net, but being ...
6
votes
1answer
280 views
Is there a way to clear paths previously defined with name path global in TikZ
In the solution to Intersections in PGFplots it was pointed out that each \addplot command was drawn in its own scope and using name path would not survive outside of that \addplot command. The ...
5
votes
4answers
519 views
Obstacles to simulating an amsmath matrix by a TiKZ matrix of math nodes
I'm trying to figure out a TiKZ-based solution to this problem involving arrows between matrix rows. To this end, I would like to at least be able to make a matrix of math nodes simulate the behaviour ...
4
votes
2answers
843 views
node names and nested loops in TikZ
I'm trying to draw a (part of a) lattice. To achieve that I use two nested foreach loops, like this:
\foreach \x in {-1, 0, 1} {
\foreach \y in {0, 1, 2} {
\path node (\x.\y) at (\x+\y-1, ...
0
votes
1answer
502 views
TikZ-pgf directed graph: change arrow color and location
I have something like this:
\SetVertexNormal[Shape = circle,
LineWidth = 2pt]
\SetUpEdge[lw = 1.5pt,
color = blue]
...
\begin{tikzpicture}
\Vertex[x=0 ,y=0]{1}
...
184
votes
2answers
19k views
Create xkcd style diagram in TeX
The unique style of the diagrams at xkcd has an informative but nice hand-drawn touch. I guess they are actually drawn by hand but just recently on our partner site for Mathematica someone asked how ...
49
votes
3answers
5k views
Putting a timeline for dates in moderncv
This question led to a new package:
moderntimeline
I just had the idea of using a timeline to specify dates in my CV. I've made a mockup in Inkscape:
The idea, as you see it, is to display ...
55
votes
6answers
2k views
What is the minimum one needs to know to use TikZ?
I am fed up with the poor quality of the pictures in the papers written by my graduate students and am trying to convince them to use TikZ. I know of three ways to begin learning TikZ:
The TikZ ...
46
votes
2answers
947 views
Torn paper: matching up the torn edges
I recently asked a question on creating a torn paper effect. JLdiaz provided an absolutely beautiful answer, which I have used (with a very minor modification) to indicate the way in which a document ...
40
votes
2answers
1k views
Recreating a guilloche with TikZ
One of my last questions talked about certificates and I got great answers. Now my questions is, can one recreate a guilloche in TikZ like the one shown below:
or may be a border like
