Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [tikz-pgf]

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.

31
votes
8answers
3k views

What has been your most complicated TikZ drawing?

Share your most complex TikZ drawing and learning out of it.
7
votes
1answer
158 views

Using for loop in tikz to draw repeated shapes

I am trying to create a lenticular pattern like the one in the picture. I believe the repeated shape can be drawn using a for loop in tikz, but I wasn't able to get it done properly. Appreciate any ...
1
vote
1answer
51 views

The right way to use tikz in a table?

I am making a table where I want simple tikz line drawings in the cells. This is my first attempt to use tikz so I am likely to have made all sorts of mistakes. This is my attempt: \documentclass[]{...
3
votes
1answer
53 views

The Area of a Region Bounded by Two Graphs

I am looking for a more professional program from that here below. I believe I can name the curves and have TiKz calculate the points of intersections instead of finding them with a pen and paper. I ...
6
votes
3answers
141 views

How to clip a background including nodes according to an arbitrary shape?

The following WE \documentclass[border=10pt]{standalone} \usepackage[dvipsnames]{xcolor} \usepackage{tikz} \usetikzlibrary{arrows.meta,shapes, positioning, fit, backgrounds} \tikzstyle{backA}=[...
4
votes
1answer
110 views

Permutations of squares

Consider the following problem: Imagine you choose 3 squares out of a 3x3 field. So you can have a line upwords or downwords, two squares downwords and one to the right etc. So let's number every ...
3
votes
2answers
53 views

How to remove the tiny invisible TikZ picture frame? [duplicate]

Consider this example: \documentclass{article} \usepackage{tikz} \usepackage[showframe]{geometry} \usepackage{lipsum} \begin{document} \lipsum[1] \noindent\begin{tikzpicture} \draw (0,0)--(\...
3
votes
1answer
69 views

How can one go about drawing a sphere with a hole using pgfplots or TikZ?

I want to draw a sphere with a hole as shown below: What I have done so far is to create an outline of the required shape in Inkscape and export to a pstricks picture. The autogenerated code is as ...
1
vote
1answer
33 views

How to display the value of a variable in a tikz diagram?

I have a computed a value in a variable in my tikz diagram \def\smax{750} \def\samb{100} \def\H{5} \pgfmathsetmacro\R{H*\sqrt{((\smax*\smax)/(\samb*\samb)-1)}} I want to display the value of \R in ...
1
vote
0answers
11 views

Defining main colors and sub colors [duplicate]

I am using the packages xcolor and tikz. I have defined my own color in rgb which name is MyColor1. I am using multiple times in TikZ MyColor1!50!white and I want to define it as Mycolor2 so that if ...
5
votes
1answer
60 views

How to draw different lines with different colours using tikz l-systems

I am trying to make a picture of an infinite rooted ternary tree, the following code will do the job quite nicely. \documentclass[12pt]{article} \usepackage{tikz} \usetikzlibrary{lindenmayersystems} ...
1
vote
0answers
36 views

Converting Tikz code to PGF

I would like to convert an SVG image (from inkscape) into PGF so that I can call the image using include package{pgfornaments}. Using svg2tikz (Save As > Latex with PStricks and Save As > Tikz code),...
3
votes
2answers
144 views

How to write ı (i without dot) character in pgf-pie

\i uses count function instead of showing "ı" character. Tried \i, {\i} $$\i$$, \imath \text{\i} but continues to count. \documentclass[12pt, letterpaper, oneside]{article} \usepackage[T1]{fontenc} \...
2
votes
1answer
50 views

3D pressure field representation

I would like to make a 3d version of the figure below I can draw the different vectors but I can not represent the cylinder. \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc,...
0
votes
1answer
56 views

Draining bathtub geometry using TikZ

How can I draw this sketch using TikZ? Has anyone done something similar? Thanks in advance!
2
votes
1answer
50 views

How to select a range of data in tikz-pgf?

This is a subset of my table that I want to use to create a stacked bar chart: Is it possible to select columns A through F for the first two rows and then select column G for the other rows to ...
1
vote
1answer
33 views

How to switch row/column in a stacked bar chart

This is my MWE: \begin{tikzpicture} \pgfplotstableread{ % Read the data into a table macro Label First Second Third Yes 0.1 0.3 0.3 No 0.9 0.7 0.7 }\datatable \begin{...
4
votes
1answer
40 views

Set rectangle widths to match sides of other figures in a diagram and make arrow lines horizontal without shifting

In the following diagram, some distances are set manually testing different values, but they do not have exact dimensions. \documentclass[12pt]{article} \usepackage{tikz} \usepackage[active,tightpage]...
1
vote
1answer
46 views

Saving tikz figures in external file

I have several tikz figures, some of which are over 400 lines of code. This complicates my working on the main file since I have to scroll past all that code quite often so I was thinking I put it in ...
0
votes
1answer
54 views

Unable to compile basic tikz codes from pgfmanual

In last semester, I started using LaTeX just for assignments and homework but now I wanted to take to the next level. I started with the tikz library following the pgfmanual. Everytime I try to ...
10
votes
3answers
1k views

How to draw cubes in a 3 dimensional plane

So I want to draw a picture like this. However I can get no where close to it. I have tried following other posts and adapting them which has allowed be to set the axis up correctly but I just cannot ...
5
votes
2answers
326 views

How to draw two different grounds

I wanna draw a ground with three lines (see Fig. a.), but in circuitikz, the ground is associated with four lines (see Fig. b.). My question is that is it possible to draw a nice ground with three ...
4
votes
1answer
43 views

Need to tilt this image inside the page so it is a perspective path, with tilted text. Path coming out of the page

\documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows,decorations,patterns,positioning,automata,shadows,fit,shapes,calc,decorations.markings,backgrounds,scopes} \newcommand{\xyz}{ \begin{...
0
votes
1answer
32 views

How to fix circles as background and write text and insert figures in the foreground in a0poster?

Please find the MWE below and kindly help me to fix my issues. \documentclass[portrait,a0b,posterdraft]{a0poster} %% posterdraft is for printing the poster on a4 size. \usepackage[paperheight=119cm,...
1
vote
0answers
38 views

How to build a saved anchor in pgf-tikz without repeating calculations

I've made a new shape in PGF-TikZ with an anchor (b anchor) which depends on some options. The following code works, but I need to repeat calculations to make the line in the shape and to place the ...
3
votes
2answers
82 views

ER diagram relationship node size adjustment

I am trying (unsuccessfully) to reduce the size of the CONTRACTED_By relationship in this ER model using the tikz-er2 package. It naturally scales the height with the width, but I would prefer the ...
3
votes
1answer
43 views

Tikz: Transforming axis to skip an interval

Two graphs are illustrated in a diagram, with quite a lot of space inbetween, making it rather unsightly. I would like to move them closer together by skipping the space inbetween. This is the ...
6
votes
1answer
189 views

How to draw a diagram of custom subject correlativities

I need to create a large diagram i.e. a diagram of custom subject correlativities but I am not able to do certain things. To do this I am going to use TikZ. Ingredients The ingredients are: A title....
4
votes
1answer
28 views

How to bend text so that it follows the curves of a Venn diagram

I need to make "class A", "class B", "class C" follow the curves of the circles immediately containing them: \documentclass{article} \usepackage[english]{babel} \usepackage[utf8]{inputenc} \...
7
votes
1answer
165 views

One circle's diameter is different from others within a series of circles

I want to construct a series of circles which ranks shoulder to shoulder in every page footer. The number of circles is just the number of total pages, that is to say, each circle represents a page. ...
3
votes
1answer
62 views

Change orientation of a TikZ mindmap node

Here my MWE using code from the Arrows e decorations.text : \documentclass{article} \usepackage{tikz} \usepackage[paperwidth=15cm,paperheight=19cm]{geometry} \usetikzlibrary{mindmap,shadows,...
2
votes
1answer
43 views

How to plot waves representing wireless link connection and set the exact width of a box from one point to another

The following diagram represents two devices connecting wirelessly. \documentclass[12pt]{article} \usepackage{tikz} \usepackage[active,tightpage]{preview} \usetikzlibrary{shapes,arrows.meta,calc,fit,...
2
votes
1answer
51 views

Difference between having \begin{axis} blablabla \end{axis} and \draw[->]?

What is the difference between them? Which one is better for what purposes? If im writing a paper in mathematical analysis, which should i use?
2
votes
1answer
46 views

3D rotated coordinate system on the interaction point of a line and an arc in Tikz

I want to draw a 3D (rotational) Cartesian coordinate system as shown in the attached figure. As a new user of TikZ, I stuck on the following points: 1) How to plot two arcs with same center and ...
3
votes
3answers
156 views

Computation logic of Partway in TikZ

PGF Manual pg. 66 describes about Partway Calculations. In this example, ($ (A)!.5!(B) $), .5 refers to 50% right? A point that is 50% away from point A. In that case, why do we require point B in ...
1
vote
2answers
69 views

Color each edge separately in TikZ

I want to color the edge AB with thick blue color and edges AC and BC with thick red color. Referring to the answer in Multiple color edges in TikZ, one way is to use the \clip[draw] command. But, I ...
5
votes
1answer
36 views

Arrow and label positing in a .pic using tikz

I am trying to draw a figure, which repeatedly contains a similar type of pictures. Hence I am using .pic provided by tikz in the following way: \documentclass[tikz, border=2px]{standalone} \...
3
votes
1answer
81 views

Drawing Torus with semi-dashed line on it [duplicate]

I would like to draw : To draw the above torus, I have used the following codes : \documentclass[margin=2mm,tikz]{standalone} \usepackage{pgfplots} \begin{document} %Oberflächenproblem \begin{...
1
vote
4answers
422 views

Draw this image in the TIKZ package [closed]

I need to draw this image using TikZ.
1
vote
1answer
41 views

How to define chamfered rectangle as .pic in tikz?

I am trying to generate a diagram which repeatedly contains the same graphics. See below a sample graphics: This is how I am generating it: \documentclass[tikz, border=2px]{standalone} \...
2
votes
2answers
136 views

Carnot and Otto cycle diagrams in Latex using Tikz or PStricks

How can I generate P-V or T-S plots for Carnot and Otto cycles? In addition to what are shown in the pictures, I would like to put directional arrows for steps starting from 1 to 4. Also, I was ...
6
votes
1answer
272 views

TikZ rotated text looks washed

I got that issue that a rotated text looks washed when you use the package: \usepackage[T1]{fontenc} Sadly I can't reject the fontenc-package because it has a lot of dependencies to the rest of the ...
3
votes
2answers
53 views

How to make circles with arrows?

\documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.text,calc,arrows.meta} \begin{document} \begin{tikzpicture} \coordinate (O) at (0,0); \draw (O) circle (2.5); \draw (O) circle (1....
0
votes
1answer
17 views

Reset vertex name counter in tkz-berge

I have a following graph constructed with tkz-berge library. In the current settings the nodes/vertices are numbered automatically started with index 0. I wonder how to reset the counter in order to ...
4
votes
1answer
67 views

How to draw multiple fillable PDF forms inside a rectangle using `tikzpicture` environment

I would like to draw two differents pictures. One of them consists of two rectangles, one with text and the other (below the first) with fillable text, as shown below: Here is text of this length is ...
1
vote
1answer
26 views

pgfplots - remove xz and yz background planes

I'm trying to get a 3dplot with only xy plane, without z axis and zx and zy planes. To be clear, this is the best result i've got: and this is what i'd like to obtain: Here's the code: \begin{...
1
vote
1answer
55 views

how to fill the area under a curve

I can not find a way to fill the area under these 3 curves and the legend doesn't seem to show the correct line colours (the red one is missing?). Thanks. \documentclass{article} \usepackage{amsmath} ...
0
votes
0answers
40 views

How to put a graph in front of another graph in Tikz

\begin{tikzpicture} \begin{axis}[ymax=17,ymin=-1] \addplot [color=red, domain=-4:4, samples=50]{x^2}; \node[label={180:{(1,5)}},circle,fill,inner sep=1.5pt] at (axis cs:1,5) {}; \...
2
votes
3answers
233 views

Drawing the Möbius band and the Klein bottle

I have this: \begin{tikzpicture} \begin{axis}[hide axis, unit vector ratio=1 1 1, view={-30}{45}] \addplot3 [surf, domain=0:360, y domain=-1:1] ( {(10+y*cos(3*x/2)))*cos(x)}, {(10+y*cos(3*x/2)))*...
3
votes
1answer
83 views

Phase plane diagrams in latex [closed]

Is there any method to construct phase plane diagrams directly in latex? I want to sketch plots like these based on eigenvalues of a matrix. For e.g., if both the eigenvalues of a 2-by-2 matrix are ...