Tag
Tikz pgf
- How to Add Vertical Space Before a TikZ PictureAdd space before a TikZ picture with \par followed by \vspace{length}; use the starred form when the space must survive a page break.
- How to Use a Custom TikZ Shape as a Reusable Building BlockDefine a TikZ pic to reuse a custom drawing as a building block, or declare a node shape when you need anchors and node behavior.
- How to Combine TikZ Orthogonal Edges with Coordinate CalculationsCombine TikZ’s -| or |- orthogonal path operators with coordinates from the calc library, including a worked midpoint example and common syntax fixes.
- How to Autosize TikZ Mindmap Nodes to Fit Their TextLet TikZ mindmap nodes size themselves from their text, remove fixed minimum dimensions, and control wrapping with text width when needed.
- How to Move Text Higher in TikZMove a TikZ label slightly upward with the node option yshift, or position it above a path using above and adjust the gap.
- How to Set Axis Parameters in a TikZ/PGFPlots FigureSet plot limits, labels, ticks, grid, and size with key-value options in PGFPlots’ axis environment, not the outer tikzpicture options.
- How to Adjust TikZ Node Distance for Individual NodesSet a different gap for each TikZ node by specifying a length in keys such as below=8mm of A or right=12mm of B.
- How to Set the Background Color of a Multilayer TikZ NodeSet a TikZ node’s background with fill; for a rectangle split node, use rectangle split part fill to color each part separately.
- How to Draw a Battery Symbol in TikZ/CircuiTikZDraw a battery symbol with CircuiTikZ using to[battery] inside a circuitikz environment, then orient it and add a voltage label.
- How to Color Different Segments of a TikZ EdgeDraw each edge segment separately with its own TikZ color option, or use per-edge styles in a graph path, to control colors reliably.
- How to Draw a TikZ Line Thinner Than 0.1 mmTikZ accepts physical dimensions for stroke width: set line width=0.05mm, or use ultra thin, and check visibility at final output size.
- How to Draw an Edge From a TikZ Node With No Target NodeDraw a dangling TikZ edge by starting at a node anchor and ending the path at a relative coordinate, such as ++(1,0).
- How to Make a Symmetric Logarithmic Axis in PGFPlotsPGFPlots has no built-in symlog axis mode, but you can transform x coordinates and label ticks with their original values.
- How to Fix a Shell-Escape Error with PGFPlotsA PGFPlots shell-escape error usually means your document is launching an external command. Find the trigger, then enable shell escape or remove it.
- How to Use the Same Color with Different Bar Patterns in PGFPlotsUse TikZ’s patterns library and set pattern and pattern color on each PGFPlots bar series to distinguish bars without changing their color.
- Why Are PGFPlots ybar Patterns Not Showing?Make PGFPlots bar patterns visible by loading TikZ’s patterns library, setting a pattern and pattern color, and checking for conflicting fill styles.
- How to Fix “Package pgf Error: No Shape Named … Is Known”A TikZ “No shape named ... is known” error usually means a coordinate refers to an undefined node. Find the bad reference, check names, and repair path syntax.
- How to Draw Pascal’s Triangle in TikZGenerate Pascal’s triangle in TikZ with nested loops and PGF math. This complete example computes coefficients and centers each row automatically.
- How to Make a PGFPlots Contour Plot from Matrix DataPlot matrix data as a PGFPlots color map by supplying x, y, and z values, setting mesh/rows, and adding contour levels.
- How to Use \pgfmathsetmacro in a TikZ \foreach LoopUse \pgfmathsetmacro inside a braced TikZ foreach body, and account for loop scope if you need its result after the loop.
- How to Set the Sampling Step Size in PGFPlotsPGFPlots has no direct step-size key for function plots; calculate the sample count from the domain length and desired spacing.
- How to Make a Broken Y-Axis in PGFPlotsCreate a broken y-axis in PGFPlots by stacking two aligned axes with different y limits, matching x limits, and a visible gap.
- How to Align Histogram x-Ticks to the Left of Each Bin in PGFPlotsUse PGFPlots' ybar interval style and place xtick values at bin boundaries to align x-axis ticks with the left edges of histogram bins.
- How to Set a PGFPlots Search Path for Data FilesUse PGFPlots’ table/search path key to find data files in a directory, rather than graphicx’s graphicspath, which is for images.
- How to Make a PGFPlots Function Touch the Plot EdgesSet explicit PGFPlots axis limits and match the function domain to them to draw a curve up to the plot edges.
- How to Change the Anchor of a TikZ or PGFPlots PinSet the anchor of an individual TikZ or PGFPlots pin with per-pin options, or style every pin consistently; includes a compilable example.
- How to Combine PGFPlots with One Legend and Rotate ThemArrange multiple PGFPlots panels with one shared legend, then rotate the complete graphic using graphicx’s rotatebox command.
- How to Make a TikZ Picture a SubfigurePut each TikZ drawing inside a subfigure environment from the subcaption package to give panels individual captions and references.
- What Do “Bend Left” and “Bend Right” Mean in TikZ?In TikZ, bend left and bend right curve a to or edge path relative to its direction; learn the default angle, syntax, and a compilable example.
- How to Control the Layout of Bar Charts in LaTeXUse PGFPlots to arrange bars as grouped or stacked series, control spacing and labels, and place multiple bar charts side by side with groupplots.
- How to Draw a Wire Kink Over Vertical Wires in CircuitikZDraw a wire crossing over vertical wires in CircuitikZ by replacing each crossing with an arc and masking the wire underneath.
- How to Fix PGFPlots Out-of-Memory Errors with Large Data FilesLearn why large PGFPlots tables exhaust TeX memory, how to reduce the data, and when externalization or engine settings can help.
- How to Fix “LaTeX Error: Environment tikzpicture Undefined”Fix the LaTeX “tikzpicture undefined” error by loading TikZ in the preamble, checking the environment placement, and installing PGF if needed.
- How to Install the TikZ Package for TeXstudioInstall TikZ through MiKTeX, TeX Live, or your operating system’s package manager; TeXstudio itself does not manage LaTeX packages.
- How to Export TikZ Figures to EPSCompile a standalone TikZ figure to PDF, then convert it to EPS with pdftops -eps; check fonts, bounding box, and transparency afterward.
- TikZ or EPS: Which Should You Use for LaTeX Figures?Compare TikZ and EPS for LaTeX figures, including editability, compiler compatibility, output quality, and when to choose each format.
- How to Fit a TikZ Figure on a Landscape PageUse pdflscape to rotate the page and adjustbox to constrain a TikZ figure’s width and height while leaving room for its caption.
- How to Draw an Equilateral Triangle in TikZDraw an equilateral triangle in TikZ by placing its third vertex at the correct height, or use polar coordinates for a compact construction.
- How to Draw a Double-Headed Arrow in TikZDraw a double-headed arrow in TikZ with the <-> option, or use arrows.meta for customizable arrowhead styles and a complete example.
- How to Draw a Car Profile with TikZDraw a side-profile car in TikZ with a closed body path, Bézier curves, windows, wheels, and details in a complete LaTeX example.
- How to Draw a Half Arrow in TikZPlace an arrowhead halfway along a TikZ line with decorations.markings, or draw an arrow over just half the line by splitting the path.
- How to Draw Electric Network One-Line Diagrams in TikZDraw an electric network one-line diagram with TikZ using nodes for equipment, lines for connections, and thick strokes for busbars.
- How to Make a TikZ Arrow Label Perpendicular to the ArrowUse TikZ’s sloped node option to align a label with an arrow, then add rotate=90 to turn its baseline perpendicular to the path.
- Change a CircuiTikZ Current Arrow and Label Color TogetherSet CircuiTikZ's draw color on the component path to color its current arrow and label together; learn what else that setting affects.
- How to Make Beamer Objects Appear in Different PlacesUse Beamer overlay commands to change what appears, and TikZ overlay nodes when an object must occupy precise positions on different slides.
- How to Annotate a Slope Triangle in a PGFPlots AxisDraw a slope triangle in a PGFPlots axis with axis-coordinate segments and labels for the run, rise, and calculated slope.
- How to Fix “TeX Capacity Exceeded: Input Stack Size=5000”The TeX input stack error usually signals recursive macro or file input, not a diagram that is merely too large. Find the loop and fix its cause.
- Why Does an Arrow Disappear in a TikZ Draw Command?TikZ arrows can disappear when a path ends at a node center and the node covers the arrowhead. Use to or explicit shape anchors.
- How to Add a Label to a Plot in PGFPlotsIn PGFPlots, label a curve with \addlegendentry or annotate a point with a TikZ node placed at an axis coordinate.