Stack Exchange Network

Stack Exchange network consists of 174 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.

1
vote
1answer
16 views

Tikz: Align text in nested nodes

The following code: \documentclass[tikz, border=1mm]{standalone} \usepackage{tikz} \usetikzlibrary{backgrounds, positioning, fit} \begin{document} \newcommand{\boxdist}{3cm} \newcommand{\textwdh}{...
0
votes
0answers
14 views

How can I give this perspective with Tikz?

I am trying to complete the image of the figure: I know how to perform the dashed circle and the legs of the table. The problem is to draw the upper part of the table. Can you give me a hint of how to ...
2
votes
0answers
14 views

torn paper problem compile

I read this article about how to make a torn paper effect. So I tried the code below, but some errors arise. \documentclass[a4paper,11pt,twoside]{book} \usepackage{lipsum} % To generate test text \...
3
votes
2answers
52 views

BlochSphere package : draw black axis

I need to draw the x,y,z axis of my bloch sphere in black (with an arrow at the end of them). I tried this code which doesn't work (my axis are light grey). How to fix it ? I am not sure to ...
2
votes
0answers
17 views

Doublet vector field not showing up as expected

I'm a bit confused with how to use quiver in pgfplots, I want to plot two equations, z = x/(x^2 + y^2) z = -y/(x^2+y^2) but when putting these into pgfplots and using the following code, \addplot3[...
5
votes
2answers
124 views

Inaccurate Calculations By pgfplots

In graphing a certain function using pgfplots (link here) I noticed a distortion in the curve that at first I assumed must have been a point of inflexion - but on investigating the maths, found that ...
2
votes
2answers
47 views

How to remove one of the sides and show the inside of a cuboid

I would like to remove the top side of the following cuboid, \documentclass[border=3mm,tikz]{standalone} \usepackage{tikz} \newif\ifcuboidshade \newif\ifcuboidemphedge \tikzset{ cuboid/.is family, ...
3
votes
1answer
34 views

PGFPlot vector field has uneven display

I have a simple 2D vector, however the points are aligned such that the vectors at the top pointing upwards are not include in the plot. I was wondering if there's a way to make the vector field more ...
5
votes
1answer
32 views

Restore TikZ settings after {pgfonlayer}

This is kind of a follow up question of Bug in TikZ? Line width on layers. When using a {pgfonlayer} two problem occure: a) inside of the background scope settings from e.g. every picture are missing....
1
vote
1answer
14 views

Removing vertical grid lines from graph

I am trying to remove the highlighted vertical grid lines from my graph. How would I achieve this? The following is the code I have written: \documentclass[]{article} \usepackage[margin=0.5in]{...
0
votes
0answers
13 views

Enlarging area or scaling the plot

I have made my plotting setup using tikz. It displays some characteristics in dependence on the time. It works fine, all test passed. However, with longer time spans, I am running out from the valid ...
0
votes
0answers
11 views

tikz/fit around node with label above // refer to node.label [duplicate]

I want tikz to draw an automatic fitting outer node around an inner node combined with its above-label, i. e. the size of the outer node should be computed by tikz basing on the inner-node-size and ...
3
votes
1answer
37 views

Dual y-axis plot

Want to do a dual axis plot and I am stuck with some details - maybe someone can point me in the right direction? The main problem is that both bar plots overlap! \documentclass[border=5mm]{...
1
vote
1answer
16 views

How modifying the width of xticks line in a barplot?

I have the following plot The code for obtaining it is \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepackage{tikz} \usepackage{pgfplots,pgfplotstable} \pgfplotsset{compat=1....
16
votes
2answers
1k views

Bug in TikZ? Line width on layers

I found a curios behavior in TikZ. If I set the line width globaly or for the current scope it wont affect the line with inside a {pgfonlayer} but the arrow tips are changed: Did I found a bug and ...
8
votes
2answers
311 views

Drawing Shapes on Graphs

I am trying to draw a regular pentagon on a graph (I need to add more stuff to it, so having the axis is desirable), but when I try to draw the two together they do not line up. Here is my code: \...
2
votes
1answer
70 views

How do I draw a labeled diagram like following

I believe there is help to draw the nodes and edges using Tex, but how do I draw the text on top of the edges?
1
vote
1answer
212 views

PGFPlots + TikZ: Stranger Beamer behavior

I am trying to include a PGFPlots + TikZ figure in a beamer presentation made with the metropolis theme. If I compile the figure in a normal article class (or standalone), the figure is fine. The code ...
4
votes
3answers
203 views

Naming intersection points of a grid

Is it possible to automatically give names to all intersection points of a grid, so that I can draw from a specific intersection to another. In my example, I manually gave names to the coordinates of ...
1
vote
1answer
29 views

Fit a circuit figure in beamer presentation

I am trying to fit this circuit in beamer presentation. \documentclass[aspectratio=169]{beamer} \usepackage{tikz} \usepackage{circuitikz} \begin{document} \begin{frame}{Lets unfold the box} \begin{...
2
votes
1answer
41 views

pgfonlayer pgfplotstableforeachcolumnelement issue

This is the continuation of this issue and this, where I try to draw normal distributions along the regression line for different x values in 3D. The problem now is, for all distributions, I try to ...
3
votes
1answer
47 views

Drawing a node parallel to any of the x, y or z axis in a rotated tridimensionnal picture

I want to draw a node exactly parallel to one of the three axes that are rotated. One solution could be to compute the axis angle relative to the horizontal line but I don't know what is the best way ...
2
votes
1answer
63 views

Drawing 2D shapes using 3D coordinates with tikz

I tried to draw planetary system consisting of Sun-Venus-Earth. My code is \begin{tikzpicture}[scale=0.1] %-> DEFINITIONS %... sizes \def\srad{10} \def\erad{3} \def\eorb{60} \def\vrad{0.3} \def\...
1
vote
1answer
74 views

Plotting a parameterized curve on a certain coordinate system

Trying to plot the 3D curve (t,t^2,2*t^3), t\in [0,1], with the code: \begin{tikzpicture} \begin{axis} %view={105}{5}, [samples y=0, axis lines=center,axis on top,xlabel=$x$, ylabel=$...
2
votes
1answer
82 views

3D arrow with shade and text with tikz

I want to create a figure as shown with latex/tikz. It contains a three-axis space, 3D arrow with text inside and shadows, and 3D-rotated axis titles etc. Only other examples I find are about 3D ...
0
votes
1answer
77 views

How to make this graph?

Is there any software, which provides Latex code, where can I make this graph? Or could you help me do this using Tikz?
1
vote
1answer
110 views

Marks do not appear in 3D for 3D scatter plot

I am trying a 3d scatter plot as below, however marks are circles, appearing only in 2D always whichever view I choose. I want them to be flat on the X-Y plane. Please let me know how to do it. I ...
3
votes
1answer
213 views

Drawing 3d grids (cubes)

Reading a few examples, while not being optimal, or organized, I was able to reach the following 3D grid drawn \documentclass[12pt]{article} \usepackage{tikz} \usetikzlibrary{positioning} \begin{...
5
votes
1answer
64 views

How to retrieve regression line to plot normal distribution upon it

This is a continuation of this question. Below is my current output and problematic area is that brown curve. I am trying to plot pdf as a 2D graph standing upon the regression line (red). I am ...
2
votes
1answer
83 views

TikZ: create break in arc behind diameter?

In the picture below, where the back portion of the great semicircle "ducks behind" the arrow-headed diameter, I manually stopped and restarted the arc drawing on the two sides of the diameter. The ...
4
votes
1answer
108 views

Draw the four conic sections

I want to draw the four conic sections (circumference, ellipse, parabola, and hyperbola) as shown in the picture: MWE: \documentclass{article} \usepackage{pst-plot} \usepackage{tikz} \begin{...
2
votes
1answer
441 views

Tikz 3d trimetric view coordinate calculation bug

I'm trying to draw a line in the x-y-plane and circles in the y-z-plane at constant x position. Problem is, that the circle is far out of position (x-coordinate of center point of the circle is ...
4
votes
1answer
129 views

Drawing an arc to this image

I used the result in this post to achieve a rotation of a cone about an 3D axis. I am unsure on how to implement the following to this image: I would like the imaginary lines that run along the '...
4
votes
1answer
215 views

Draw lower (southern) hemisphere and great semicircle with “mathematician's” axes orientation

With tikz and tikz-3dplot I want to draw: the unit lower (i.e., southern) hemisphere; and on that two great semicircles through the south pole, i.e., point $(x, y, z) = (0, 0, -1)$, the first joining ...
3
votes
2answers
146 views

Draw the three cylindrical sections

I want to draw the three conic sections (circle, ellipse and rectangle) where the cylinder and cross sections are colored: \documentclass{standalone} \usepackage{tikz} \usepackage{animate} \...
5
votes
2answers
119 views

draw a technical instrument geophone

Could you help to draw the geophone? \documentclass[border=5mm,tikz]{standalone} \usetikzlibrary{decorations.pathmorphing,patterns} \begin{document} \begin{tikzpicture} \pgfmathsetmacro{\...
9
votes
1answer
168 views

How to draw a 3d horseshoe in TikZ

I am trying to draw an experimental setup involving a horseshoe magnet. I am having difficulty of hiding lines that should not appear, and I am unsure how to use shading to indicate the different ...
4
votes
2answers
216 views

Improve or simplify this TikZ code for southern hemisphere?

The code below is based upon the answer by @Max to the question Draw lower (southern) hemisphere and great semicircle with "mathematician's" axes orientation. Question 1. Can the code ...
8
votes
2answers
237 views

Water inside a hemispherical bowl

I am trying to draw the diagram below in latex I got this far with the following code: \documentclass[]{article} \usepackage[margin=0.5in]{geometry} \usepackage{pgfplots} \renewcommand{\thesection}{\...
5
votes
2answers
230 views

Drawing a perspective ellipse with TikZ

I made the following ellipse in Inkscape But I would like to draw it within TikZ environment.My final goal is to put this ellipse inside a coordinate system. Using the image from Inkscape, here is ...
4
votes
1answer
814 views

Drawing circles on a 3D Plane

I have this steel plate, and I want to put a circle on it so that the circle lies in the "horizontal" plane of the plate: % vim: ft=tex \RequirePackage{luatex85,shellesc} \documentclass[tikz]{...
12
votes
1answer
468 views

How to draw an arc for a bullet

My apologies in advance if you feel that this question is more about drawing instead of being technical. The following diagram is what I want to replicate in Latex: I believe I have done most of the ...
5
votes
1answer
453 views

How to draw circles in an arbitrary plane

I would like to generate the following image of TikZ: The closest resemblance on the examples is this post. However, I am not sure how to add the circles in the plane of the cubes. Any help is ...
11
votes
2answers
215 views

How to do a planar/multiview/first-angle projection in Tikz?

I need to make quite a few "first-angle projection" in Tikz (see Wikipedia ) for an exercise sheet, so I was wondering if there is a routine to make them? By this I mean that I could give a certain ...
10
votes
1answer
394 views

How to draw the following diagram (a wedge of cheese) using pgfplots or tikz?

I would like to draw the diagram below using either pgfplots or tikz. I am able to draw a cylinder, using the pgfplots manual, but I don't know how to draw a fraction of a cylinder.
17
votes
1answer
2k views

3D Arrow Tips for TikZ/pgfplots

I really like the arrow tips shown in How to get rid of the viewer's (incorrect) axes in an Asymptote 3D graphics and am wondering how to produce this in pgfplots: I admit I have not tried yet, ...
10
votes
3answers
857 views

3D Cartesian Coordinate System

I want to modify my three-dimensional Cartesian coordinate system as shown in the picture attached. I would like to have numbers under my ticks. I want parts of the grid to be parallel to the x_1 ...
2
votes
1answer
35 views

Advanced Fraction with several Level

I would like to ask, how could I use LaTex to create following tools refer to the uploaded graph. Do you have some idea to mock such tool in following graph? Some descriptions: The Tool is for ...
18
votes
2answers
1k views

Tikz: Draw a RGB cube

I am trying to draw a RGB cube using Tikz. Until now I managed to create this cube with color gradients: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{3d} \usetikzlibrary{shadings} \...
64
votes
2answers
19k views

Drawing simple 3D cylinders in TikZ

I'm trying to draw some simple 3D objects in TikZ. I can do spheres and cuboids okay, but I'm struggling with circular cylinders: When rotating the scene (I use tikz-3dplot for this), the end faces ...