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
0 answers
5 views

Using latex tikz package alongside anki version 23.12.1

Summary of the problem I've been attempting to get the latex tikz package working alongside my anki version (23.12.1) without success. I'm doing this to include drawing that are illustrative to my ...
croakouttatune's user avatar
1 vote
0 answers
34 views

How to place tcolorbox on top of tikzpicture

I have a tcolorbox which I want to place just above a tikzpicture which has a number of transitions. However, try as I might I can't do this without error. My MWE has two frames so that it renders. ...
gaussplustwo's user avatar
0 votes
1 answer
33 views

define color for group bar chart fail

I would like to define different color for group bar chart, below code report error: \documentclass[varwidth,border=7]{standalone} \usepackage{pgfplotstable} \pgfplotsset{compat=newest} \...
lucky1928's user avatar
  • 4,089
2 votes
3 answers
37 views

Align tikzpicture with textwidth

i have this tikz graphic, but sadly it doesnt align with the textwidth. How can i accomplish that? \documentclass[12pt]{article} \usepackage[onehalfspacing]{setspace} \usepackage[left=3cm,right=3.5cm,...
nflgreaternba's user avatar
0 votes
0 answers
28 views

How do you generate geometric figures and sketches [closed]

I'm just starting to use LaTeX to write my thesis and I find myself stumbling on how to generate nice looking geometric figures for sketches. Not necessarily a plot, but a nice sketch to convey an ...
giorgioh's user avatar
  • 101
2 votes
1 answer
69 views

Realistic spiral binders with tikz

I was viewing this thread recently, and was struck by a great answer provided by Gonzalo Medina (reproduced below). As good as this was, I think the output would look much better if this answer could ...
wrb98's user avatar
  • 910
4 votes
2 answers
115 views

Why explicitly and inexplicitly declarated nodes produce edges with different length?

The following code block contains a minimal working example. The first TikZ drawing doesn't use explicitly defined nodes. The second TikZ drawing uses explicitly defined nodes. I thought that these ...
rdrg109's user avatar
  • 351
0 votes
0 answers
44 views

Need help tikzing the following graphs [closed]

I just need help tikzing the following diagrams. I spent a while trying to align the coordinates and the labels, but it just won't work. If it's not too demanding, can someone tikz all of the ...
xeji45's user avatar
  • 11
0 votes
1 answer
33 views

Improving Arguelles, a beamer theme, circumventing the use of TikZ in background definition

I found a very neat beamer theme (Arguelles, https://github.com/piazzai/arguelles) however there are three things that I believe are troublesome with the theme. I am trying to improve them but I am ...
Cryme's user avatar
  • 731
1 vote
2 answers
50 views

Using CalcLength to mark points on a segments using tkz-euclide

I have the following: \documentclass{article} \usepackage{tkz-euclide} \begin{document} \begin{tikzpicture} \tkzDefPoint(0,0){X} \tkzDefPoint(2.5,-2){Y} \tkzDefPoint(2,1.5){Z} \tkzDrawPolygon(X,Y,Z)...
Paul A's user avatar
  • 921
0 votes
2 answers
73 views

How to draw the shape shown in the below image?

\documentclass[12pt]{article} \usepackage{tikz} \usepackage{tikzpagenodes} \usetikzlibrary{arrows, shapes, positioning} \begin{document} \pagestyle{empty} \begin{tikzpicture}[remember picture, overlay]...
Vishakha's user avatar
1 vote
1 answer
44 views

How to give the shadow effect which is shown in the below image for the white rectangle in the code?

\documentclass[12pt]{article} \usepackage{tikz} \usetikzlibrary{arrows, shapes, positioning} \begin{document} \pagestyle{empty} \pagecolor{blue!50} \begin{tikzpicture}[remember picture, overlay] \fill[...
Vishakha's user avatar
1 vote
1 answer
53 views

Adding some lines to my Block diagram in Tikz

The objective is to draw feedback lines from the output to both the MPC and PID, as illustrated in the accompanying images. \documentclass[border=3cm]{standalone} \usepackage[dvipsnames]{xcolor} \...
Moein's user avatar
  • 23
0 votes
1 answer
32 views

Efficient "macro" for adding second (x-)axis to pgfplots

Lately, I have had to rely extensively on adding a second x-axis to my plots. I am doing so using the following script (see MWE), however, to me it seems quite inefficient and there's a lot of double ...
Bart Wolleswinkel's user avatar
0 votes
2 answers
53 views

How to increase space between diagrams

I have changed the radius of the circle and made them larger and am unsure how to change the space between them because they overleap. Thank you. \documentclass[tikz, border=5]{standalone} \newcount\...
user292225's user avatar
0 votes
2 answers
57 views

Coloring the region under the standard parabola in TikZ

I have the plot of a parabola over the interval [0,1] and a line segment between (1,0) and (1,1). I would like the region between the parabola and x-axis and to the left of this vertical line segment ...
user143462's user avatar
  • 1,029
0 votes
0 answers
28 views

Get Tikz/pgfplot figure (quiver+contour) as seen in MATLAB

I have a rather involved MATLAB script that plots the gradient field vectors to be exactly the lengths between the contours of a surface. I want to be able to have this graph natively drawn in LaTeX. ...
David G.'s user avatar
  • 205
1 vote
1 answer
40 views

Using foreach and cs coordinates, foreach evaluate and axis

I was trying to draw dots over a pgfplots axis using axis cs coordinates. This works just fine typing the coordinates by hand, but fails as soon as I try to use the value coming from a foreach ...
Cryme's user avatar
  • 731
1 vote
1 answer
53 views

Using the result of TikZ foreach evaluate

I was trying to display the value of an evaluated variable in a TikZ foreach loop on a very basic example (tweaked from https://tikz.dev/pgffor#pgf./pgf/foreach/evaluate), but somehow it fails. See ...
Cryme's user avatar
  • 731
-1 votes
1 answer
59 views

How to draw this figure in latex, using same arrows and braces? [closed]

I need code to draw this figure in latex
Parul Chauhan's user avatar
4 votes
1 answer
74 views

PGF/TikZ Object-Oriented Programming Scope Issue

I'm experimenting with the PGF/TikZ Object-Oriented Programming functionality and have encountered what appears to be a scoping issue that I do not understand. I have provided a minimum example of the ...
James Gardner's user avatar
0 votes
2 answers
66 views

Rectangular node with cross (plus) marks at the edges

I want to divide the working area into some parts and then mark their borders with plus marks. I can do this separately: \documentclass{article} \usepackage[margin=1in]{geometry} \usepackage{...
Przemysław Scherwentke's user avatar
1 vote
2 answers
55 views

tkz-euclide: Set style of angle marks globally

How can I control globally the styles of angles and marks, particularly the color and line thickness/length, with tkz-euclide? I am not sure how to set styles like mkcolor globally. I'm looking to ...
PatrickT's user avatar
  • 2,901
0 votes
0 answers
39 views

How to plot ternary heatmap from .csv data?

I am trying to plot a ternary heatmap using the ternaryaxis environment. This is supposed to plot a variable over three factors that go from 0 to 100. The code I am using is the following: \...
Kaza123's user avatar
0 votes
2 answers
59 views

Chemfig and TikZ

How can I make a chemical graph, with empty boxes, like this: In chemfig + TikZ? Or there is some other way? Somebody try something like this before?
Michał Szymankiewicz's user avatar
2 votes
0 answers
53 views

How to inject \directlua expansions back into TeX files

Is there a simple way (i.e. a flag to latexmk) to preprocess a source TeX file with LuaLaTeX, so that I get back the same source with just the invokations to \directlua expanded? My usecase is that I ...
Champitoad's user avatar
1 vote
0 answers
38 views

tikz: Error that appears only in a certain order of two pictures

I have a very strange behaviour in the following simple code. The purpose is to draw two knots by using tikz, with tikzlibrary knots. \documentclass{amsart} \usepackage{tikz} \usetikzlibrary{knots} \...
user126154's user avatar
3 votes
2 answers
188 views

tikz-cd "equal" arrow with a colored background

I use a Beamer template with black background. Whenever I type an equal arrow with tikzcd, it appears as a large white line (because some background is added between the two lines of the "equal&...
sparusaurata's user avatar
3 votes
2 answers
197 views

Generate TikZ \pics dynamically

I want to generate TikZ \pics dynamically. All information I need to setup the pic (name, x-coord, y-coord) are given in a tabular. Is there a way to inject these information to the TikZ environment ...
PascalS's user avatar
  • 766
1 vote
1 answer
43 views

How to print a \pic in TiKz aligned to one of its border?

The following MWE shows how to draw a background image with scaling and adding a predefined "PowerSupply" pic to it. This works great but the problem is, that the position where I want to ...
PascalS's user avatar
  • 766
0 votes
1 answer
36 views

How to put the caption of a TikZ Picture below an image when using overlay option?

How to put the caption of a figure below an image when using overlay option? I want to avoid to shift the caption manually via \vspace{} or something like that. \documentclass{article}% \usepackage[...
PascalS's user avatar
  • 766
2 votes
1 answer
75 views

Drawing a basketball using Latex

Could you help me to draw a basketball using latex. I tried this version but it doesn't seem to be working. \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \shad[...
Mario Topez's user avatar
0 votes
1 answer
77 views

Visual errors in pgfplots graph [closed]

This is my code \documentclass{article} \usepackage{amsmath, pgfplots, tikz, fullpage} \pgfplotsset{compat=1.15} \begin{document} \begin{tikzpicture}[scale = 1.5] \begin{axis}[ xlabel = {$...
Clyde Kertzer's user avatar
1 vote
1 answer
65 views

TikZ strange default anchor behavior

I am using TeX Live 2023 downloaded from the site on WSL2 Ubuntu 22.04. Using XeTeX to generate PDF documents. xetex -v is XeTeX 3.141592653-2.6-0.999995 (TeX Live 2023). As part of planning to work ...
Kishan Parekh's user avatar
0 votes
0 answers
40 views

Converting plots to tikz code

I am trying to convert the following plot to a tikz code I have seen from some previous QA that first png to svg conversion and after that svg to tikz convertion is possible. I tried to convert this ...
Tanmoy Pati's user avatar
0 votes
1 answer
57 views

Inclined plane with friction

How can I draw friction lines under the box $M$ in the following TikZ draw...? \begin{figure}[h] \centering \begin{tikzpicture} [font = \small] ...
hyriusen's user avatar
  • 167
0 votes
0 answers
48 views

pgfmathsetmacro, pgfmarthparse, pgfmathresult to define command with calculation

I am quite new to using tikz and the pgf package in general, and I'm having a hard time understanding how/when to use pgfmathsetmacro, pgfmathparse and pgfmathresult. I have the following problem: I ...
Pedro Montanari's user avatar
3 votes
1 answer
100 views

Create an electrical installation plan in TikZ

I'm trying to document my electrical installation neatly in Latex and TikZ. A normal TikZ drawing is no problem so far, but I would like to add something like switches, sockets, etc. to a given ...
PascalS's user avatar
  • 766
1 vote
2 answers
50 views

pgfplots bar plot: add labeled arrow from one bar to another

I have a pgfplots chart looking like this. \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \begin{document} \begin{tikzpicture} \begin{axis}[ ybar, bar width=1....
npas's user avatar
  • 13
1 vote
0 answers
22 views

Strange sign change in math operation result with tikz [duplicate]

I am working on a 3d figure using pgfplots. Since I need to operate on some pre-defined functions which are y(x) = - 1 - x and zed(x,y) = - x^2 - y^2. I want to place points using these functions so I ...
Meclassic's user avatar
  • 1,783
0 votes
1 answer
58 views

Replacing a square with a star in TikZ

In the code below I would like to replace the box by a star. How do I do this? \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \begin{document} \begin{center} \begin{tikzpicture} ...
Zoltan Fleishman's user avatar
3 votes
0 answers
124 views

Is It possible to draw 2 merging spherical caps with tikz?

I am trying to reproduce a figure using only tikz. I have produced the figure using Inkscape but I am wondering if I can do it fully in Latex. This is the aimed figure : And with the help of some ...
Waxler's user avatar
  • 584
0 votes
1 answer
39 views

How highlight date or week in TikZ Calendar with background color?

How to highlight a date or week in TikZ Calendar with a background color?
Paulo Rodrigues's user avatar
6 votes
1 answer
545 views

TikZ in XeLaTeX vs. LaTeX

I have a document with some complicated mathematical diagrams (system of commutative maps, arrows and labels). It seems to build the diagrams correctly only in XeLaTeX. The rest of the document ...
mbsq's user avatar
  • 161
-1 votes
0 answers
37 views

Cartesian graph [duplicate]

How can I draw this graph using latex[graph of 2x^2 + 9x + 14]
Anthony Ikenna Obiamalu's user avatar
0 votes
1 answer
48 views

How do I draw a line to connect one entry to another within a tabular environment?

I have a tabular environment intended as an exercise in a textbook. I want it to look like this: And the student is meant to complete the exercise by connecting the remaining lines. Question: How do ...
Rebecca J. Stones's user avatar
0 votes
0 answers
43 views

PRISMA Flow Diagram [duplicate]

Can someone please help me creating this PRISMA 2020 flow diagram? I’m new to Latex and my advisor is forcing me to use TikZ instead of uploading a picture.
user314172's user avatar
3 votes
3 answers
243 views

Is there a way to choose a "horizontal center" of a TikZ picture?

I want my TikZ figure to be horizontally centered around a coordinate. In this example I want the horizontal center of the figure to be at the center of the square, x=2, but a text node extends beyond ...
Anna's user avatar
  • 751
1 vote
1 answer
89 views

Using TikZ (or other package) to draw a gameboard, somewhat similar to chess (Hnefatafl)

I need to write some documentation and need to display a Hnefatafl board. Basically it is an 11x11 board, some of the squares would be highlighted (e.g. cross hatching). The pieces are basically ...
LewisE's user avatar
  • 11
0 votes
0 answers
35 views

Crash of Texstudio 4.7.2

Starting with version 4.6.2 of TeXStudio (updated also to 4.7.2), when compiling complex code or very simply code I have a crash with this message: Help me!
Raffaele Santoro's user avatar

1
2 3 4 5
691