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)

1
vote
1answer
362 views

TikZ bounding box too big

I'm fairly new to LaTeX and I'm trying to make a homework template that uses figures generated in LaTeX but when I use TikZ I get a bounding box that is way too large. What is the easiest way to ...
1
vote
1answer
251 views

TikZ Issue With Function Plotting

I am trying to create this simple TikZ plot of a quadratic function. But the code does not compile, and the error is detected at the part where I introduce the function. What is wrong with it? \begin{...
3
votes
0answers
52 views

Tikz, Tangent Line to a Circle [duplicate]

Why is the tangent not really horizontal? \documentclass{article} \usepackage{tikz} \usepackage{circuitikz} \usepackage{pst-solides3d} \usetikzlibrary{shapes,decorations} ...
16
votes
4answers
1k views

How to draw the following box using TikZ?

How to draw the following boxes using TikZ? EDIT (22.09.)
2
votes
1answer
180 views

Path shaded perpendicular to its direction

Is ist possible to apply a shading to a path perpendicular to it's current tangent. I want to draw some kind of 3d-pipe. My question is related to this question. I want to draw 3d-molecules and I am ...
4
votes
1answer
927 views

How do I set only one side of a tikz node's border color?

I want to have a node with different border colors: One for the upper and left border, one for the lower and right color. The result should look like this: Is this possible? From all examples I ...
2
votes
2answers
147 views

Labels that are parallel with edges of a triangle

The following code is compiled to give a right triangle. The labels for the lengths of the legs and hypotenuse are present and "sloped." I would like them to be outside the triangle. \documentclass[...
4
votes
1answer
192 views

Changing axes' origin adds weird whitespace

I would like to display points in a Tikz picture, whose y components are all negative. That is per se no problem, but I want the y axis to be a bit higher than the x axis to emphasize the negative ...
4
votes
3answers
448 views

Drawing a curve in Tikz

I would like to redraw the following graph on latex. I can make the grids but cannot reproduce the graph correctly. Any ideas on how to reproduce the curved line?
3
votes
1answer
140 views

How can a style applied to a given node be inherited by all descendants of that node?

I'm using the graphs TikZ library to draw directed acyclic graphs. When I apply a particular style to a given node, I would like that style to be inherited by all descendants of the node in question. ...
2
votes
1answer
456 views

Tikz/Forest: highlighting level background

I am using the Forest package and I am trying to paint a gray background for odd and even rows, as well as a label. I already had a version of this diagram that I wrote "manually" with tikz. But it ...
2
votes
1answer
157 views

h- and v- phantom a tikzpicture

I try to hide a tikzpicture : Depending on a boolean, I want to see or not the tikzpicures of a document (show them on display, but hide them on paper) in order to students draw them. The hidden ...
3
votes
1answer
118 views

Erratic behaviour with TikZ … \foreach

I am using TeXShop v 2.47 on a MAC (OSX 10.6.8) and trying to learn TikZ; which is very powerful but not the easiest package to get to master. I have been getting very strange behaviour with the \...
5
votes
1answer
1k views

Understanding TikZ border anchor

Consider the following MWE: \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture} \node(a)[rectangle,draw,minimum size=3cm]{}; \node [...
1
vote
1answer
337 views

Draw curved lines with arrow in LaTeX (TikZ)

I need to write a paper and include some graphics. The image I want to include by TikZ is the one on the link. The idee is to draw three curved lines, en put in the middle an arrow (the directions in ...
4
votes
2answers
720 views

how to draw plate indices in graphical model by tikz

I made my Hierarchical model with tikz by following code: ‎‎\documentclass[10pt,a4paper]{article}‎ ‎\usepackage[utf8]{inputenc}‎ ‎\usepackage{amsmath}‎ ‎\usepackage{amsfonts}‎ ‎\usepackage{amssymb}‎ ‎...
1
vote
2answers
766 views

Interval of x tick labels are to close

I have some trouble with the interval of the x tick labels. I have two much labels so the text overlap each other. My code is following: \begin{figure} \begin{tikzpicture} \begin{axis}[ width=0....
9
votes
3answers
445 views

First half of plots is missing

I want to draw some functions with gnuplot. It works well, but the first half is missing and I don't know why. \begin{figure}[htpb] \begin{center} \begin{tikzpicture} \begin{axis}[width=0.8\textwidth,...
5
votes
1answer
309 views

font size in chemfig

I am using chemfig scaling and want to increase the font size, but not any other parameter of the molecule. So a MWE would be: \documentclass{article} \usepackge{chemfig} \begin{document} \...
5
votes
4answers
521 views

Tikz-Control relative coordinates in background layer

I am creating a block diagram which has two layers : the main one and the background one. What I am trying to do, is draw a rectangle as a background using relative coordinates. My code is \...
2
votes
0answers
194 views

Arrow head at end of spiral curve

Folks, Here is my MWE. I need to draw a spiral for trigonometry more than one revolution. How to place an arrow head on the spiral where it meets the terminal end? \begin{tikzpicture}[scale=1.5, ...
3
votes
1answer
603 views

\addplot3 in pgfplots plots data beyond axis limits

When using pgfplots for a 3D graph and reading the data from a table, is there a way to truncate the data at the axis limits specified in the axis environment ? Here is a MWE: \documentclass[tikz]{...
8
votes
1answer
375 views

Multi level timeline

I am fairly new to LaTeX and I want to write my internship report with it. I have briefly summarized the history of the company and I want to use something visual. I tried to reproduce this (done ...
1
vote
0answers
141 views

Tikz \draw not working with several tikzpictures on the same page [closed]

I need to output a bunch of number lines from a program, to latex, and I'm using tikz. On these number lines, some areas need to be highlighted, like in the first line of the picture. However, if a ...
5
votes
3answers
696 views

How to make an open circle in a number line?

This is a follow up question to Labeled Number Line My question is how can I make an open circle (to indicate an open interval) using Gonzalo Medina's answer.
13
votes
1answer
3k views

How to plot the first n rows of a table using pgfplots?

When using pgfplots, is there a way to plot only the first n rows of a given table ? Considering the following MWE file: \documentclass[tikz]{standalone} \usepackage{tikz} \usepackage{pgfplots} \...
5
votes
2answers
275 views

drawing wind mixing in the open ocean

I am trying to draw a diagram showing the influence of wind speed for mixing in the ocean. Here is my attempt (apologies for the long code, I'm guessing this can be done in a much more elegant way but ...
6
votes
1answer
2k views

Rotate Tikzpicture including nodes

Is there any simple way to rotate a whole tikzpicture environment? If I apply the tikzpicture option [rotate=ang] nodes seem to be unaffected. In other words, I want to do \begin{tikzpicture}[...
4
votes
2answers
205 views

Cylinder with lines indicating the height

Any advice how to place some lines (like ticks) in the cylinder indicating the cylinder height? It should look like this: Here my MWE: \documentclass[english]{beamer} \usepackage[utf8]{inputenc} \...
4
votes
1answer
152 views

Draw plots with tikz

I would like to do the following graphic in tikz. But I do not konw how to proceed... How could I do that? EDIT So far, I have tried simpler things (before getting to this bigger problem). I have ...
4
votes
1answer
471 views

Global definition of pgfplots axes style conflicts with colorbar

I am trying to plot an individual colorbar (with no axis), using the code below (MWE): \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.3} \begin{document} \begin{...
3
votes
3answers
771 views

How to cross out a child of a node in a tikz tree?

Consider this simple tikz tree: \documentclass{article} \usepackage{tikz} \usetikzlibrary{trees,shapes,snakes} \begin{document} \tikzstyle{mynode} = [text width=4em, text centered] \begin{...
10
votes
3answers
1k views

Parabolic Moebius map on sphere using tikz

There is a discussion here about coding the elliptic Moebius map. I however am interested in how I might do the parabolic one. case [d] The arrow heads are not an issue, but how do I get the lines ...
1
vote
1answer
444 views

Code for drawing two intersecting lines and the acute angle between them

Here is the code for two intersecting lines. I know the code that I use to draw lines $\ell$ and $k$ is bad. I am sure that is the reason that the labels $\ell$ and $k$ are not in the right places. I ...
7
votes
1answer
2k views

How to draw Latex multiple bar chart with error bar

Can someone help me with putting error bars on multiple bar graphs. This is what I currently have and it doesn't look any good, so far :( \begin{figure} \begin{tikzpicture} \begin{axis}[ x tick label ...
2
votes
1answer
307 views

How to draw 3-junction and 4-junction SQUIDs?

UPDATE Thanks to John Kormylo I was able to draw a 4-junction SQUID using four components like: The whole SQUID is drawn using the following code \documentclass{article} \usepackage{tikz} \...
1
vote
0answers
50 views

draw on pdf file [duplicate]

I have such a case: I got one pdf file but it's read only,I wish to draw on it. so I think maybe I can do it as below: 1). embed origin.pdf into latex code as a picture. 2). find right position to ...
5
votes
3answers
352 views

tikzpicture: “rounded corners” and “west arc=none”

here's my MWE: \documentclass[a5paper]{book} \usepackage{tikz} \usetikzlibrary{positioning,shapes.misc,calc} \begin{document} \begin{tikzpicture}[overlay,remember picture] \node[ ...
6
votes
2answers
2k views

Tikz-Connecting nodes with multiple lines

I am trying to reproduce the following image I made in "Power point". Although, there is no difficulty in designing the boxes, I find it rather hard to properly position the red and black lines. ...
15
votes
2answers
478 views

Ideas for transposing/splitting a TIKZ figure from A4 article to beamer presentation

Context. I am having this kind of tikzpicture in my article which I would like to include in a beamer presentation : Please note that the figure was simplified, since groupI represents a group of ...
10
votes
7answers
826 views

How can I draw circled integers with the same size by TikZ?

I used the statement \newcommand*\circled[1]{\tikz[baseline=(char.base)]{ \node[shape=circle,draw,inner sep=2pt] (char) {#1};} } to draw some circled integers. Ex. \circled{$X'$} \circled{$1'$} ...
0
votes
2answers
249 views

Have one plot as background for stacked plots

I have a series of plots that are stacked up: \documentclass{article} \usepackage{pgfplots} \usepgfplotslibrary{external} \pgfplotsset{compat=1.10} \tikzexternalize% activate externalization! \begin{...
5
votes
1answer
374 views

Unclutter a bar plot with pgfplot

I have the given bar plot with three hirachies (color + inner-group + outer-group): The figure look overloaded but I don't know how to split the x axis labels in a better way. A possible solution ...
5
votes
1answer
189 views

Problem parsing product `2\x` with `TiKZ 3.0`

I was used to write 2\x to obtain the product 2*x but today I've found this is not correct anymore in TiKZ. Next code \documentclass[tikz,border=2mm]{standalone} \begin{document} \begin{...
0
votes
1answer
365 views

How to place two bar charts beside each other

There are two tikz barcharts in this snippet. I'm able to display barcharts one after another but when i use subfigure/subfloat its giving an error \documentclass[preprint,12pt,3p]{elsarticle} \...
3
votes
2answers
2k views

How can I draw Pascal's triangle with some its properties?

At here Pascal's triangle in tikz we can draw Pascal's triangle. Now I want to note some properties of coefficients C_{n+3}^4 -C_{n+2}^4-C_{n+1}^4+C_{n}^4=n^2 (the first picture) as folowing ...
2
votes
2answers
152 views

TikZ - set of 1-d point charges

Trying to create a set of alternating (+q,-q etc.) Point charges on a line? Completely new to Tikz. Thanks in advance.
4
votes
2answers
94 views

tex4ht styling breaks after figure containing tikz drawing

\textbf works in tex4ht before the figure environment, but not after: \documentclass{book} \usepackage{tikz} \begin{document} \textbf{this is bold} \begin{figure}[h] \begin{tikzpicture} \draw[...
8
votes
1answer
222 views

Hatching that does not obscure a right-angle mark

Hatching - I suppose in the northeast direction - is to be added to the square with an edge length of $c$ in following diagram. I have a right-angle mark at one of the corners of the square. Is there ...
5
votes
2answers
750 views

Moving a node a bit

The following code instructs TikZ to draw an obtuse triangle. Except for the placement of the letter "C" in the diagram, the diagram is drawn correctly. I want to move the letter "C" downwards a ...