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)

2
votes
1answer
279 views

Centering and Reference Coordinates

Question 1 Can I define reference coordinates for x and y and then use these coordinates to adjust my figures inside a Tikz picture? As an illustration, if I want to readjust all the rectangles in ...
2
votes
1answer
484 views

latex graph points tikz

I drawed a simple path in graph \begin{center} \begin{tikzpicture} \tikzstyle{every node}=[draw,shape=circle] \draw[xshift=-1cm] (-2,0) node[circle,fill,inner sep=1pt,label=below:$x$](x){}; ...
3
votes
2answers
353 views

Write numbers and draw rectangles with foreach

I am trying to draw a below given diagram for myself. I have been able to draw the rectangles using \foreach however I am unable to write numbers below the boxes as shown. Could somebody help me in ...
1
vote
1answer
375 views

Overlay subfigure caption with TikZ

I'm trying to place my figure captions on top of the figures. I've found some code that does this and I can get it to work for a normal figure - e.g. I can overlay "Figure 1" on top of the figure. ...
1
vote
1answer
186 views

\pgfdeclareshape: how to define anchors in a loop?

I think my question is quite similar to this and this, however I didn't manage to modify the provided solutions to fit my problem. In the following MWE I am trying to define 8 pin anchors in a ...
3
votes
2answers
417 views

tikzpicture to create a first page with an image in background taking the whole page

I am trying to create a newsletter with Latex, but I am not expert at all. My goal is, for the moment, to create a first page (the cover), with an image in the background, and some text overprinted. ...
3
votes
1answer
60 views

Breakage of Tikz fill operation on cycle path with let and node reference?

Consider this MWE: \documentclass[varwidth]{standalone} \usepackage{tikz} \usepackage{calc} % \widthof \usetikzlibrary{calc} \pagecolor{yellow!15} \begin{document} \begin{tikzpicture} \node (neL0) ...
3
votes
1answer
199 views

Pgfplots axis environment, loop for function works but not for plotting options

My question is related to this one, \foreach not behaving in axis environment , but the solution there does not work in my case and unlike the related question, the loop works well in the axis ...
2
votes
0answers
22 views

Passing changing (in a loop) parameters to Pgfplot function [duplicate]

Usually I just use TikZ for plots but was hoping Pgfplots would simplify life (axis, labels, etc...) but I can not find what is the right syntax to pass parameters to the function. Here is the MWE: ...
4
votes
1answer
1k views

TikZ - flexible arrow positioning

The following MWE is translating to the desired tikz picture, but the code is not very useful for adjustments. Especially the positioning of some arrows is done very poorly by defining coordinates ...
3
votes
1answer
1k views

TikZ: Replacing the values (labels) on x-axis with names

I managed to create a simple linear plot with pgfplots-manual (chapter 4.5.1) Now I want to replace the values of x-axis (1,2,3,4) with text, e.g.Test A, Test B, Test C, Test D. How can I do such a ...
1
vote
1answer
152 views

Embedded axis Pgfplots

So I need to display data as follows: every day for a month I have a set of values obtained in different hours. I want the axis to contain the date but between a date an another I want to have the ...
5
votes
1answer
2k views

“Illegal unit of measure (pt inserted)” using arithmetic in TikZ foreach

I am using a \foreach loop in TikZ with \i in {2,3,..,5} and I'd like to be able to use the value \i-1. However, every approach I have tried gives me a Illegal unit of measure (pt inserted) error. ...
0
votes
1answer
202 views

How can I connect centers of nodes defined using let in a foreach loop?

I want to create a star polygon using a \foreach loop to make nodes for the vertices and another \foreach loop connecting, say, every 4th node. \documentclass[12pt]{amsart} \usepackage{tikz} ...
3
votes
1answer
128 views

Tikz: Drawing lines with \draw[opacity = 0] produces .dvi files in which the lines are visible

Here's my MWE: \documentclass[11pt]{article} \usepackage{pgf,tikz} \begin{document} \begin{figure} \begin{tikzpicture} % Bounding box coordinates \coordinate (q) at (1, 0); ...
6
votes
0answers
101 views

Trying to draw a line that changes color [closed]

I'm trying to use tikz to draw a line that changes color at two different points. As you can see from the code below, what I want is a line that starts solid red, changes to dotted gray, and ends as ...
4
votes
2answers
557 views

TikZ diagram: concentric circles and 'freehand' curves

I have the following diagram which (or a nicer looking version of which) I'd like to recreate using TikZ. Can anybody point me into the right direction? How do I do the concentric circles? How the ...
3
votes
1answer
174 views

Connected dashed lines between 3 diagrams and curvy lines

I would like to make the three following diagrams which are interconnected. I meet two difficulties: both how to make these curvy lines within each diagram and how to connect them with dashed lines. ...
4
votes
1answer
109 views

How add decoration arrow for pgfplotfunction

I want to draw a series of curves with directions. pgfplotfunction is an option because it's easy to draw curves in a batch. However, I don't know how to add annotation arrow for it. It's there a ...
3
votes
2answers
496 views

How draw smooth “rounded arrows”?

I have the following diagram: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \coordinate (shift) at (1mm,0mm); \node [draw=black, ...
1
vote
1answer
187 views

How can I use the tikz external library in tikzposter?

I am using tikzposter to make a poster (obviously). I would like to insert a few rather large tikz figures in that poster. This really lengthens the compilation time. Usually (when writing articles) ...
10
votes
1answer
2k views

How can I fit the original data with exponential or polynomial functions via pgfplots?

I am trying to plot the following data with a curve fitting via pgfplots. It seems linear regression is not suitable for my case. So I would prefer to have exponential or polynomial curve fitting on ...
3
votes
1answer
143 views

Self Intersecting Diagrams, PSTricks

Okay, so I have a self-intersecting curve drawn using \pscurve in PSTricks, and I would like the interestions to look something like -|- as opposed to +. I know it can be done using double lines in ...
3
votes
2answers
642 views

Drawing a styled node invisibly (phantom / off-screen)?

Consider this MWE: \documentclass[varwidth]{standalone} \usepackage{tikz} \usetikzlibrary{calc} \usetikzlibrary{positioning} \pagecolor{yellow!15} \begin{document} \begin{tikzpicture} \makeatletter ...
3
votes
1answer
361 views

TikZ: Skinny ellipse around two horizontally and vertically offset nodes in a tree

As a follow up question to draw an ellipse into a Tree picture -tikz package, how would one go about making a skinnier ellipse that encircles two horizontally and vertically offset nodes in a tree? ...
3
votes
1answer
817 views

Location and size of pgf plot axis in a tikzpicture - with tikz positioning library?

This could be a second part to Positioning pgfplots axis in tikzpicture , I guess ; consider the following MWE: \documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{positioning} ...
2
votes
0answers
120 views

Referring to nested tikz nodes - works with pdflatex but not with latex

I am trying to achieve a box within another box in tikz and then drawing an edge from the inner box to an outer node. I stumbled upon this solution When I compile it using pdflatex, I get the desired ...
5
votes
2answers
371 views

Do multiplication rules differ in TikZ compared to standard TeX?

I'd like to scale a line according to \figscale. Here it is said that the below syntax should work in general, but in this graphic it does not. As the picture shows, the numbers are just concatenated ...
2
votes
1answer
724 views

For loop in UML activity diagram

I'm looking for a package/code snippet to have this kind of diagram. Any ideas?
4
votes
3answers
674 views

TikZ: circle split vertical

I want to split a TikZ node into a left and a right part, just like circle split does in upper and lower part, e.g. \node [circle split,draw] (x){$a$ \nodepart{lower} $b$} Is there a vertical ...
4
votes
1answer
264 views

How to access last node in TikZ?

I am trying to make a simple figure using TikZ. Here is my code \documentclass{minimal} \usepackage{tikz} \usetikzlibrary{calc} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture} ...
2
votes
1answer
128 views

increase zorder in chemfig+tikz

I have a chemfig structure where I want to highlight certain positions by drawing a simple circle at the atom site. This works so far, but I would also like to have the new nodes on top of the ...
1
vote
0answers
124 views

how to draw a unfinished data point bar in pgfplots?

I want to present some experiment comparisons. One of the candidate (SHJ) takes too long to run. Could anyone give me some suggestions on how to present such data point in a bar chart? Thanks in ...
5
votes
2answers
2k views

How can I annotate an image with arrow and text? [duplicate]

I am using LaTeX to make a manual. I would like to annotate an image with arrows pointing to parts of the image and a textual annotation outside of the image. Is there a simple way I can do this with ...
2
votes
1answer
69 views

Trouble with tikz and def

I'm trying to combine two different suggestions people made about an earlier question I asked. I'm getting a bunch of errors, but I'm not sure what the problem is. The code is: ...
8
votes
2answers
580 views

draw rectangles with common edge

I would like to following picture in tikz, for which I have written the code. However scaling this image, distorts the location of the rectangle nodes. In my picture shown, there are common edges ...
3
votes
1answer
251 views

setting values in tikz picture

To anyone who can help me: I recently found this code posted as an answer to this (Drawing Karnaugh's maps in LaTeX) question on TeX exchange but I am having trouble adapting it to my needs. ...
3
votes
0answers
422 views

How can I create airfoil images for fluid mechanics presentations in Tikz? [closed]

I need some help on how to create good looking vectorized images of these kinds of themes: I work a lot with Latex when it comes to typesetting so I have some basic experience with Tikz. However ...
4
votes
1answer
170 views

pgfplots: strange opacity in surf plot

I do have the following code to get a surf plot which gives me for some reason the 'backside' of the plot with full opacity. How can I change this behavior? Actually, I think this feature is very ...
3
votes
2answers
444 views

What is the simplest way to draw such chart?

is any pre-difined shapes to draw such chart, or I have to use line by line for it? Thanks in advance.
12
votes
5answers
753 views

How to refine this tikz diagram?

I'm working on this diagram: \documentclass[border=2mm]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \clip (-0.1,-0.1) rectangle (5,3); \draw[help ...
8
votes
1answer
2k views

Remove space in empty node so that draw line is connected

I'm trying to remove the white space that appears between two lines as a result of going to an empty node. Specifically, I have a node drawing to the left of the empty node and then the empty node ...
3
votes
1answer
243 views

change position of TikZ node halfway

I am trying to move the node "H" to one of the two positions shown in red below: I am not sure how to position it at 'intermediate' positions such as I am suggesting. How could this be done? Is ...
1
vote
2answers
92 views

Conversion of graphics

since I am lacking of skills in tikz and others, I am currently doing some graphics in Powerpoint (Word) and trying to include them into LaTeX afterwards. For now, I am copying the graphic into paint, ...
5
votes
1answer
150 views

TikZ: Key to the \draw command to modify the inside nodes

Suppose I have the following code: \documentclass{article} \usepackage{tikz,amsmath} \begin{document} \begin{tikzpicture}[scale=6] \tikzstyle{xthick} = [thick, |-|] \tikzstyle{xthin} = [] % ...
1
vote
1answer
352 views

Bars with same x index in stacked barplot

I'm reading data that is structured as an outer group (the x indices/rows) with different inner categories (multiple columns) that are composed of multiple values themselves again. The goal is to ...
4
votes
2answers
318 views

Align two nodes of different tikzpicture at the center of the page

I have a problem with the alignment of two tikzpicture environments. \documentclass[14pt,spanish]{extarticle} \usepackage{fontspec} \setmainfont[Mapping=tex-text]{Ubuntu} \usepackage{geometry} ...
3
votes
1answer
143 views

Prevent double-frame with mdframed/tikz

I want to create a digression using mdframed. I want it to have rounded corners, so I load it with option [framemethod=tikz]. Because of this, the problem arises that the standard framebox I use for ...
6
votes
0answers
236 views

Cube with louvre planes in LaTeX [closed]

I have this code which produces the diagram below: \documentclass{article} \usepackage{tikz} \usepackage{verbatim} ...
2
votes
1answer
252 views

Combine 3 graphs into 1 and add additional labels

I would like to make the following figure: So, far I have made only each curve in separate figures. How can I combine them into one? How can I have the dashed lines and how can I add the '1st ...