New answers tagged

0 votes

TiKz crashes when trying to plot with an axis with more than 31 ticks

I solved it, although I don't know what the solution has to do with the difference between the xmax-Value and ymax-value. I simply deleted the values legendpos and grid style.
Daerker's user avatar
  • 13
2 votes

pgfplots: How to clip the decorated path to the viewport limits and make 'text align' use its new limits?

If you use clip=false, and standalone, you can see where your text goes: the line is built using the default domain (-5:5) and then clipped. Maybe you want the following (I restricted the domain of ...
Rmano's user avatar
  • 39.4k
2 votes

decorations.text: How to have math inside the text key?

I don't know why, but enclosing the math in {$ $} and adding empty {} after it did the trick and made me able to parse a complete math input. \documentclass{article} \usepackage{pgfplots} \...
Diaa's user avatar
  • 9,433
2 votes

decorations.text: How to have math inside the text key?

You cannot have an entire math formula along a path. In this case you can get an approximation by doing text = {{$\mu$} = \adhesion{} + #1}, With just two cycles, in order to reduce the ugliness: Of ...
egreg's user avatar
  • 1.1m
1 vote
Accepted

Conditional nodes near coords in pgfplots

Expanding on this great answer, you could text against the flag of the relevant value: \documentclass[border=1cm]{standalone} \usepackage{pgfplots} \pgfplotsset{width=7cm, compat=1.18} \begin{...
Jasper Habicht's user avatar
1 vote
Accepted

PGF variable content overwritten

You need to expand \slope when you call \addlegendentry or the last meaning will be picked up at print time. But there's no need to pass through \slope as \pgfplotstableregressiona would do. \begin{...
egreg's user avatar
  • 1.1m
0 votes

Is there an easy way to plot Jacobi Elliptic Functions with Tikz-PGF?

Here is my solution, a bit late. \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.15} \begin{document} \begin{tikzpicture}[ declare function={ K(\u) = pi/2*(1+(\...
Joaqun Daniel Sifuentes Rivera's user avatar
1 vote

Option clash for package xcolor

If you used tikz related package, then one way that works for my computer is to load the xcolor before tikz. Example: Correct: \documentclass[]{article} \usepackage[dvipsnames]{xcolor} \usepackage{...
Asigan's user avatar
  • 113
3 votes
Accepted

Problem with fraction display in pgfplots

Try this: Output: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ ybar, ymin=0, ymax=1, xtick=data, xticklabels={$1$, $2$, $3$, $4$, ...
John Smith's user avatar
2 votes

Problem with fraction display in pgfplots

You can use e.g. frac shift=3 The manual p. 1056 /pgf/number format/frac shift={⟨integer⟩} (no default, initially 4) In case you experience problems because of stability problems, try experimenting ...
hpekristiansen's user avatar
1 vote
Accepted

draw resonance plot with pgfplot

\documentclass[tikz, border=1cm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ xmin=8, xmax=35, ymin=0, ymax=25, ] \pgfmathsetmacro{\kd}...
hpekristiansen's user avatar
3 votes

Why the Node Labels Aren't Fully Visible in the 3D Coordinate System using pgfplots

Try this: Using the anchor property \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \begin{document} \begin{tikzpicture} \begin{...
John Smith's user avatar
1 vote

pgfplot marks with blurry outline

You can create your custom plot marks: \documentclass[border=10pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \pgfdeclareplotmark{* glow}{ \foreach \s in {0,...,5} { \...
Jasper Habicht's user avatar
2 votes
Accepted

pgfplot marks with blurry outline

Try this: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis}[ scatter/classes={ a={mark=*,draw=white,fill=red,...
John Smith's user avatar
3 votes
Accepted

How to Draw a Centered Disc Surface in a 3D Cartesian Coordinate System

I would not use any 3D tool or pgfplots for this, but just draw this with plain TikZ using polar coordinates to keep things simple: \documentclass[border=10pt]{standalone} \usepackage{tikz} \tikzset{ ...
Jasper Habicht's user avatar
3 votes

How to Draw a Centered Disc Surface in a 3D Cartesian Coordinate System

Start with this: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.17} \begin{document} \begin{tikzpicture} \begin{axis}[ title={Disc with Sector and Point P}...
John Smith's user avatar
0 votes

Includepdf causes an error message from pgfplots externalization

This issue is mentioned in the documentation. A workaround provided which includes the pdfpages package in the main document but not on the externalized documents, \usetikzlibrary{external} \...
gkaf's user avatar
  • 1
1 vote

Tell pgfplots not to try to plot where the function is not defined

The sagetex package gives access to an open source computer algebra system (CAS) called Sage along with the Python programming language. The CAS Sage is similar to Mathematica except it's free. As a ...
DJP's user avatar
  • 12.3k
3 votes

Create graph from CSV of percentage figures

Try this: Output: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis}[ title={Operating Profit Margin}, xlabel={}, ...
John Smith's user avatar
4 votes
Accepted

Create graph from CSV of percentage figures

Things are easier with the data transposed: \documentclass[border=10pt]{standalone} \begin{filecontents}{operating-profit-margin-data.csv} Year,2018,2019,2020,2021,2022 Industry benchmark,28.83,14.11,...
Jasper Habicht's user avatar
1 vote
Accepted

Making an axis break

This is how you can do it to line chart. \documentclass{minimal} \usepackage{tikz} \usepackage{pgfplots} \tikzset{ axis break gap/.initial=0mm } \begin{document} \begin{tikzpicture} \begin{...
Hasalanka Nagahawaththa's user avatar
0 votes

Axis break in pgfplots

This is how you can do it to line chart. \documentclass{minimal} \usepackage{tikz} \usepackage{pgfplots} \tikzset{ axis break gap/.initial=0mm } \begin{document} \begin{tikzpicture} \begin{...
Hasalanka Nagahawaththa's user avatar
0 votes

Add break node to plot in pgfplots

\documentclass{minimal} \usepackage{tikz} \usepackage{pgfplots} \tikzset{ axis break gap/.initial=0mm } \begin{document} \begin{tikzpicture} \begin{axis}[ name=bottom axis, legend ...
Hasalanka Nagahawaththa's user avatar
1 vote

Tell pgfplots not to try to plot where the function is not defined

This is not a full soution, but an approach to it. Instead of nesting deg() and rad(), try the r syntax that tells PGF that the value passed to trigonometric functions should be interpreted as radians....
Jasper Habicht's user avatar
0 votes

Draw loop on a torus

Like this: Code: \documentclass[border=10pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \foreach \r in {5,4.99,...,3}{% \pgfmathsetmacro{\c}{int(20*\...
Raffaele Santoro's user avatar
5 votes
Accepted

Dimension too large error GeoGebra Export

As @ManuelCart has already pointed out in a comment, the immediate cause of the error is that tan(90 degrees)=tan(((pi/2)*180/pi) isn't defined. You must restrict the domain of the functions that ...
Mico's user avatar
  • 495k
0 votes
Accepted

pgfplot fillbetween

Using the intersections segments option (see the relevant section in the pgfplots manual), you could do the following: \documentclass{article} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} \...
Jasper Habicht's user avatar
1 vote
Accepted

Parabolas with Focus and Directrix - Tikz/PGF Plots

Like this: Code: \documentclass[border=5pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[gray!40,dashed] (-9,-1) grid (5,8); % coordinate grid \draw[...
Raffaele Santoro's user avatar
3 votes

removing lines from a graph

You should learn from received answer how to draw such (or similar) answer ... For example, on your one of previous question, you got answer which solve your problem (why you not accept them? what you ...
Zarko's user avatar
  • 293k
1 vote
Accepted

Shifted stacked ybar plot

In my opinion, with the coordinates you show you overdefine the diagram. It should be sufficient to give the following, which will automatically result in the desired output (if I got right what you ...
Jasper Habicht's user avatar
0 votes

pgfplots: `visualization depends on` works only when assigning a new macro name

visualization depends on is used when the visualization of a point depends on more than just point meta. As your \addplot only has one point, it is not really applicable here although it does work. - ...
hpekristiansen's user avatar
0 votes
Accepted

Could not parse input '' as a floating point number, sorry. The unreadable part was near ''. (in ')(-1.3')

Focused just on the images: I would draw them as pure tikzpictures Curve in picture is better (and simpler) to draw as one line with defined directions relative to given coordinates. For example the ...
Zarko's user avatar
  • 293k
1 vote

How to find "missing number, treated as zero" error in a code

Your code is mess of pgfplots and tikz ways of drawing of diagrams. Please stick with just one. I would select pgfplots. At this I would consider suggestion in given link in the @Werner comment: \...
Zarko's user avatar
  • 293k
2 votes
Accepted

Pgf cone drawing

You can change the z-coordinate to {1-y} instead of {y}: \documentclass{standalone} \usepackage{pgfplots} \usepgfplotslibrary{colormaps} \pgfplotsset{compat = newest} \begin{document} %Draw axis x,...
karlh's user avatar
  • 444
0 votes
Accepted

Axis labels troubles

Welcome to TeX.SE! Please always provide complete small but complete, compilable document (MWE: Minimal Working Example) with your diagram which we can test as it is. Your problem you can solve with ...
Zarko's user avatar
  • 293k
4 votes
Accepted

Unintended scaling of a polygon

Add \pgfplotsset{compat=1.18} (or some other sufficiently new version number) to the preamble of your document. You should actually get a warning if you don't set compat saying that you are "...
Jasper Habicht's user avatar
1 vote
Accepted

How can I increase the length of the legend symbol in the legend box in PGFPlots

You can adjust the details of the legend through pgfplotsset where you can also adjust the start and end "coordinates" of the legend handles, .e.g, \pgfplotsset{legend image code/.code={% ...
BanDoP's user avatar
  • 473
5 votes
Accepted

Six-Hump Camel Function

Inspired by the answers to this question, you could try with gnuplot: \documentclass[border=10pt]{standalone} \usepackage{amsmath} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} ...
Jasper Habicht's user avatar
1 vote
Accepted

Need help creating specific Tikz picture

From the images in the question, it is not really simple to understand how they should look like. I suggest using a graphic editor, if you do not plan to explore Tikz further and then saving it as pdf....
Richard's user avatar
  • 152
1 vote
Accepted

Error while running pgfplots along with babel (French)

In case you don't need babel shorthands for your presentation, you can avoid the error by switching them of with the shorthands=off package option: \documentclass{beamer} \usepackage[french,...
samcarter_is_at_topanswers.xyz's user avatar

Top 50 recent answers are included