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.

Filter by
Sorted by
Tagged with
0
votes
0answers
35 views

Drawing a partially coiled rope in tikz [duplicate]

I'm trying to illustrate a classic physics problem where a rope that is coiled on the ground is lifted by one end until it is vertical; a quick online search turned up this hand-drawn sketch. Is it ...
3
votes
3answers
247 views

In Tikz, how to set a node's label alignment to the left?

I have a simple node (rectangle) with a label a the top. I would like that label to appear on the top left, but I'm failing at understanding how to do so. Here's what I'm aiming for: and here's my ...
3
votes
2answers
156 views

Shading an area

What is the best way to shade the area as indicated in the image below? \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw (0, 0) rectangle (10, 10); \draw (0, 10)...
3
votes
2answers
60 views

Color gradient in circle from center and keep transparency

So I am trying something: I want to have a loop reading out the position of circles from a dat file. The plotting already works very well. However now I want to implement a gradual shading from semi ...
1
vote
1answer
31 views

\node : Undefined control sequence with tikz

\documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture}[node distance=2.5cm,auto,>=latex', squarednode/.style={...
1
vote
1answer
31 views

Theorem-style numbering for tikzpicture?

I make a lot of diagrams and other illustrations in TikZ, and I've discovered a need to give them reference numbers - is there a good way to do this?
7
votes
2answers
110 views

Choose columnsep depending on page

I wish I could set a different columsep on the page if it is the title page of the chapter. So far I've tried using a conditional ifchapterpage with the code within makeatother found in here (by @...
3
votes
1answer
49 views

Alignment of labels in tikz nodes

Please consider the following example. \documentclass[12pt]{standalone} \usepackage{tikz} \usepackage{fontspec} \usetikzlibrary{decorations.text} \usetikzlibrary{positioning,decorations.pathreplacing,...
0
votes
1answer
57 views

Draw a hysteresis stain-stress Loop

I would like to draw a strain-stress hysteresis Loop, something that looks similar to the picture below? So far I only found this code here: \begin{tikzpicture} \begin{axis}[very thick, ...
2
votes
1answer
48 views

Custom columnsep in twocolumn book

I'm trying to customize the column separator for my two columns book class. I made a simple Tikz line to put between them but I find no way to do so. Here's a MWE of my code (I'm compiling it with ...
1
vote
1answer
26 views

How to place coordinate with particular axis

I want to draw this image: But there is a lot of things that I dont know how to do: I've created my own axis, but how to define the coordonate now ? How can i create the white, and gray rectangle? ...
1
vote
3answers
33 views

Arrow tip overlapping frame

Here are two images showing examples of what I am using in a diagram, I am giving the minimal running code just after \documentclass[border=2pt]{standalone} \usepackage[utf8]{inputenc} \usepackage{...
1
vote
3answers
54 views

CircuiTikZ Nfet Solid line

I'm trying to replace the switches in my schematic with mosfets. My switches look like this: \draw(0,0) to[nos=$S_1$] (2,0); %S1 And my mosfet looks like this: \draw(0,0) to node[nigfete, ...
0
votes
0answers
35 views

dynamically adjust font size based on length of input name

I have a document where title page includes the name of client. Font size for the name is fixed and for short names it works fine. However, whenever I have a client with longer name, my text goes over ...
13
votes
2answers
649 views

Creating patterns

Using north east hatch from the answer to this question Filling rectangle in TikZ with more than one color I wanted to make a north west hatch. However, it has funny teeth I do not know how to get ...
1
vote
0answers
24 views

tikz `trim axis {left,right}` and y-axis automatic at margin side in a twocolumn layout

I have a few graphs plotted using pgfplots: \documentclass{article} \usepackage{pgfplots} \usepackage{lipsum} \begin{filecontents}{data.csv} 0; 1 2; 3 \end{filecontents} \begin{document} \lipsum[...
2
votes
2answers
63 views

Label an edge above and below

I want to be able to label an edge with a part of the label above it and the other part below it like in the following example : For the moment I have this solution: \documentclass{article} \...
2
votes
1answer
51 views

How to draw an arrow circle at a certain coordinate?

I defined an arrow circle but I do not know, how to move it to a specified coordinate. Code: \begin{tikzpicture} \foreach \x in {0,30,...,360} \draw[<-] (\x:0.35cm) -- (\x:0.7cm); \end{...
2
votes
1answer
46 views

How to pass parameters to \tikzstyle?

I am using multipart shapes to create two-sided nodes and want to change the background color of the left node based on a user-provided (color) parameter. Changing the default parameter at \tikzstyle{...
2
votes
1answer
56 views

How to add horizontal lines in ganttchart?

I am trying to make a ganttchart using the pgfgantt package in Overleaf. I have a problem I have not managed to fix. I would like to add horizontal lines below each group. To explain myself better. I ...
0
votes
0answers
28 views

tikzpicture: specifying the minimum scale at which an element appears

I have five tikzpictures corresponding to different values of a parameter. At the end of the document, I want less detailed versions of these side-by-side, to show what happens as the parameter ...
1
vote
1answer
42 views

Volume of revolution with rotating shaded area

I did the following MFWs for teaching the notion of Volume of Revolution in Calculus. I started with: ‎\documentclass[a4paper,openany,12pt]{article} \usepackage{pgf,tikz} ‎\usepackage{pgfplots,...
5
votes
2answers
93 views

Increase letter spacing in TiKZ text decorations

I've been trying to increase the spacing between letters in the diagram below: \documentclass[12pt]{standalone} \usepackage{tikz} \usepackage{fontspec} \setmainfont{Brill} \usetikzlibrary{decorations....
1
vote
1answer
28 views

Accessing an entry in an array within Tikz within which was passed to a macro as argument?

I try to label a path with is defined by a list of coordinates (pairs of x- and y-values and no "real" tikz coordinate type). in a second list I store the labels for the edges. Both lists are input ...
1
vote
2answers
67 views

Combination of TikZ and special tables: difficulty

With reference to two previous questions A specific format for nice tables and Some adjustments of a nice table of mine to which I had an excellent answer from all users, I for example used a ...
0
votes
1answer
50 views

Plotting of piecewise functions from file

I use tikz package for graph plotting. I have piecewise function , which set as array of values in text file. How I can plot given function this way?
1
vote
1answer
34 views

Problem with babel and TikZ if any of russian, ngerman, spanish or portuguese are used

The tikzpicture in the MWE compiles without problems for greek, French, Italian and English but, if any of Russian, ngerman, Spanish or Portuguese is added to babel, ERROR ! Missing \endcsname ...
1
vote
1answer
35 views

Tikz: Correct alignment of related sub-figures

The question is perhaps similar to this one Is it possible to make an image gallery with tikz images?; but I do not want to "resize" or "adjust". The two pictures should behave as in both there were ...
2
votes
2answers
78 views

How to draw the triangle in LaTeX? [duplicate]

I know how tow draw the: \triangle{ABC} it will show but how can I draw the:
1
vote
1answer
29 views

Fill shade between x-axis,y-axis and function

I want to fill area between x-axis,y-axis and function with gray. So I search and try many things, but I couldn't understand how It Works.. anyone could help me to do this??? \begin{tikzpicture}[>=...
1
vote
1answer
37 views

TikZ: Create bounding box in tikz picture of control system diagram

I have completed writing a control system in TikZ. I now want to create two coloured "boxes" with dashed lines which should entail my controller and plant components of the entire control loop. Please ...
6
votes
3answers
582 views

Making arrow with a gradual colour

I want to make an arrow that has gradual color as shown in the picture below: First I wanted to make that arrow in one stroke, but I do not know how to make shaded color in postaction, so in the end ...
2
votes
1answer
34 views

Highlight part of axis with label on top

I have a pgfplot with time as x-axis variable. I would like to highlight certain periods of time and put a name on top of the upper x-axis. \documentclass{article} \usepackage[utf8]{inputenc} \...
1
vote
1answer
20 views

TikZ: if everything is shifted, then all the shifts get reverted

I am trying to draw a rectangle with a diagonal which are horizontally centered on the page. I tried \documentclass[12pt]{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} %The ...
0
votes
0answers
25 views

Organigrams in latex [duplicate]

hi everyone I am a newbie to latex and i'm stck in making an organigram with tikz package can anyone help please
6
votes
2answers
210 views

“Walls” of plane partition

This example by Jang Soo Kim shows how to create a plane partition using TikZ. Is it possible to modify the code there so that the partition is indeed a bunch of blocks lying on a floor and pushed ...
6
votes
3answers
303 views

Tikz Payoff Matrix

I am trying to remove the bottom two rows (C and D) completely so as to create a 2*4 payoff matrix. In addition to this, I would also like to move "Player 2" up slightly once they have been removed (...
4
votes
2answers
239 views

tikz: draw multicolor curve with smooth gradient

Yes, I know there are several topics about, but no one referred to my case. While colormap seems works only with plots, how can I draw a multicolor curve with smooth gradient? This is my attempt: \...
1
vote
1answer
20 views

Tikz: After changing the node, the label on the edges are compromised

This is a follow up question to Tikz radius of the bullets with node. Now that the style of all node has been changed, the labels of the edges are "compromised". What is a standard way to solve ...
0
votes
1answer
32 views

How to force 3 figures into 1 row

I have 3 figures that at the moment are placed in two rows. How can I force them into a single row? I have tried changing the width of the figures, but that did not make a difference. \documentclass[...
4
votes
1answer
70 views

Drawing a sigmoid function and its derivative in tikz

I created a graph of the sigmoid function using the following tikz code: \documentclass{minimal} \usepackage{tikz,pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}% [ grid=major, ...
2
votes
2answers
68 views

Tikz radius of the bullets with node

In the following picture the first graph has the correct bullet size, the second should have the same. I would like the second one to be changed in order to get the right size of the bullet without ...
6
votes
3answers
134 views

Basic calculations in PGF/TikZ for loop

I've seen a bunch of similar questions and answers relating to the same kind of problem, but they either weren't particularly well explained or something got lost in translation somewhere. So I ...
2
votes
2answers
54 views

TikZ Confusion Matrix line break

I tried a TikZ example of a confusion matrix and I want to set a line break, but it does not work. How can I set a line break in the second and third node? When I try it with "\" I get some errors. ...
2
votes
1answer
36 views

Reflecting object in tikzpicture

I'm trying to use tikzpicture to draw the different conics. To finish, I want to reflect the two arcs I drew around the y axis to get a hyperbola but I don't know how to do that. The reflected part ...
5
votes
2answers
90 views

Aligning tikz picture in equation

I am trying to write an equation involving tikz picture and math symbols. Here is the MWE: \documentclass{article} \usepackage{tikz} \begin{document} $T=\begin{tikzpicture}[line cap=round,line join=...
1
vote
0answers
27 views

Tikz package altering footer

I had two almost identical documents that were done using the exam class. The one difference between the documents was the tikz package. The document with the tikz package had the page numbers where I ...
2
votes
1answer
32 views

Stacked bar plots

I am trying to figure out a way to draw what's on the picture. Any suggestions are welcomed!
3
votes
1answer
62 views

Problem of cell height varying with text when using tikz to generate tables

I am using tikz to generate a table with the following code: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{xcolor} \definecolor{light-gray}{gray}{0.95} \newcommand{\code}[1]{\...
2
votes
2answers
68 views

How to reveal TikZ plot with \printanswers in exam class

In the exam class, you can reveal solutions by uncommenting the command \printanswers. This allows the author to keep both question and solution in the same document, without needing to manually ...