Tag Info

6

From the pgfplots documentation: In order to express relative positions (or lengths), you need to use axis direction cs. So you have to use: \draw[thick, dashed] (1,6) -- ($(1,6) + (axis direction cs:2,0)$); Example: \documentclass[dvipsnames]{article} %\usepackage[utf8]{inputenc}% need for outdated TeX distributions \usepackage{pgfplots}% loads tikz and ...

5

If you read the PGFPlots manual about marks, you will not find the ominous ominus mark. For halfcircle p. 184: mark=halfcircle One half is filled with white (more precisely, with mark color). So you can just change mark color to the same as the background: \documentclass[]{article} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} \...

4

Here is answer \documentclass[usenames,dvipsnames]{standalone} \usepackage{tikz} \usepackage{xcolor} \begin{document} \begin{tikzpicture} \draw[->] (-0.5,0) -- (6,0) node[below] {$x$}; \draw[->] (0,-0.5) -- (0,5) node[left] {$y$}; \draw[red,thick] (-.5,1) to[out=-45,in=185,looseness=2] (4,2) to[out=0,in=135,looseness=1] node [at end,below] {$f$} (6,.6)...

4

Not only the line color, cycle list in pgfplots can also control other aspects like the drawing patten, marker shape and marker options. The following example sets color series foo (the actually used color-spec is foo!![<n>]) as drawing color. You may also want to use foo as the current color of that series in marker options. Noted that pgf currently ...

4

This is an Asymptote version of parametric representation; // https://tex.stackexchange.com/questions/570157/tikz-plot-for-ennepers-minimal-surface // Enneper's Minimal Surface // ref:https://mathworld.wolfram.com/EnnepersMinimalSurface.html // // EnnepersMinimalSurface.asy // // to get EnnepersMinimalSurface.png, run // asy -f png -render=4 ...

4

You can do that with a loop. \documentclass[tikz,border=3mm]{standalone} \usepackage{xfp} \begin{document} \begin{tikzpicture} \draw[stealth-stealth] (0,5) node[below left] {$p(n)$} |- (10,0) node[below left] {$n$} ; \draw foreach \X in {1,...,18} {(\X/2,0.1) -- (\X/2,-0.1)}; \draw[dashed] (0,pi) node[left]{$\pi$} -- (10,pi); \edef\x{1} \edef\mysum{1}...

3

For a better idea what is going on, the coordinate (axis cs: 2,0) is the distance from (rel axis cs: 0,0). not (axis cs: 0,0). The extra 5 in the y direction comes from [ymin=-5]. \documentclass[dvipsnames]{article} \usepackage[utf8]{inputenc} \usepackage{xcolor} \usepackage{pgfplots,tikz} \usetikzlibrary{babel,calc,backgrounds,quotes,angles,patterns,...

3

I recreate the @haver solution from https://tex.stackexchange.com/a/520121/8650 for the Gamma function with OP code - to help people searching for continuous factorial. The real factorial is only defined for integers - see https://en.wikipedia.org/wiki/Factorial . x! = Γ(x + 1) This solution needs gnuplot and --shell-escape : \documentclass{article} \...

3

You could use pgfplots. \documentclass[tikz,border=3mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.17} \begin{document} \begin{tikzpicture} \begin{axis}[hide axis] \addplot3[surf,z buffer=sort,% %mesh/ordering=y varies, domain=0:1,domain y=-180:180] ({x*cos(y)-x*x*x*cos(3*y)/3}, {-x*(3*sin(y)+x*x*sin(3*y))/3}, {x*x*cos(2*y)}); \...

3

Since there is no "ominus-mark" you could create the marks by yourself: \pgfdeclareplotmark{myominus}{....} 1a. New. If you want to use something ready-made, you can use circle split from the shapes library. Note that the other possibility mark=halfcircle, because of "One half is filled with white", is not really suitable for a fillable &...

3

Just put the global option to local place: \addplot[error bars/y fixed=4, fill=red] Hint 1: I would only use a coordinate plot for adding individual points or something similar. The coordinate plot is unsuitable for more complex input data. So I made a table plot out of it. Hint 2: I have moved the nodes near coords to a more visible place. \documentclass[...

3

As shown in anonymous' answer, ycomb can do the job. Another way is to use ybar. This plots each data point as a vertical bar (for horizontal bars, you would use xbar). The bar width can be customized using bar width, as in: \begin{axis}[..., ybar, bar width=0.4pt] \addplot table[draw=none] {table.csv}; \end{axis} As you found out yourself, draw=none ...

3

The definition \use@@pgfplotslibrary has at the end this piece of code \expandafter\ifx\csname pgfp@library@#1@loadoptions\endcsname\relax \else \expandafter\let\expandafter\pgfplots@glob@TMPa\csname pgfp@library@\pgf@temp @loadoptions\endcsname \expandafter\pgfplotsset\expandafter{\pgfplots@glob@TMPa}% \fi Its purpose is to load ...

3

Are you looking for something like this? \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[axis lines*=middle, xtick=\empty, ytick=\empty] \addplot [smooth,tension=0.9] coordinates {(1,5)(1.5,3)(3.5,2)(5,-4)(6,4)}; \end{axis} \end{tikzpicture} \end{document} You can insert some ...

3

Here is a very basic option. Use pgfplotstable and plain TikZ to convert the data in a plot. Since it is very basic, it may be easy to customize. The prize that you have to pay is that you need to fix some things by hand in x=3mm,y=3mm,declare function={nrows=3;} which sets the units and the number of rows. (In all fairness, also in some pgfplots scenarios ...

2

For example add \fill [red, opacity=0.7] (100,0) rectangle (3000,5); \fill [black, opacity=0.2] (100,0) rectangle (3000,-10); before the \addplots. Note: this will work if you have a not very old version of pgfplots (>= 1.11) because you have set compat=newest. If you didn't have compat set to 1.11 or higher the coordinates would have to be prepended ...

2

Ah, after three years ... it seems that you like to reproduce your first image, not the second (in the question, this was a bit misleading). It ca be simply done `pgfplots: \documentclass[margin=3.14159mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.17} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture}[ lbl/.style = {fill=...

2

You could draw the second axes with specified dimensions in the same tikzpicture: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis} \addplot3[surf, samples=5, patch type=rectangle, opacity=.8, domain=-1.5:1.5, y domain=-1.5:1.5] ({x},{y},{x+y}); \node [circle,fill,inner sep=...

2

Pure TikZ variant, drawing with controls : \documentclass[tikz, border=3mm]{standalone} \usetikzlibrary{arrows.meta, intersections} \begin{document} \begin{tikzpicture}[%smooth,scale=0.8 > = Straight Barb, dot/.style = {circle, draw, thick, fill=blue, inner sep=2pt, label={[fill=white, inner sep=1pt, font=\small]...

2

I haven't found the cause of the label shift yet, I feel like it has something to do with the normalized option though. I'll look into it later. In the meantime, I wanted to propose a slightly alternative code to yours, which by the way, doesn't have the same problem. Instead of typing several \node commands, you can just do a single \addplot ... coordinates ...

2

acos is not defined if the absolute value of its argument is greater than 1. You can define a "regularized" version that yields e.g. inf if the argument does not make sense. \documentclass[margin=5pt, tikz]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}[ trig format=rad, declare function={ a=7; b=-2; c=5; Acos(\x)=(...

2

It is the purpose of mark options to control the parameters of the marks. So by dialing mark options={line width=0.4pt} you can set the line width to its standard value. \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.17} \begin{document} \begin{tikzpicture} \begin{axis}[ axis lines = left, enlarge x limits=0.1, ...

2

Here is a more primitive, yet working way to fill the intersection of both curves. \documentclass[tikz,border=3mm]{standalone} \usepackage{pgfplots} \usepgfplotslibrary{polar} %\usepgfplotslibrary{fillbetween} \pgfplotsset{compat=1.17} \makeatletter \tikzset{reuse path/.code={\pgfsyssoftpath@setcurrentpath{#1}}} \makeatother \begin{document} \begin{...

2

Asymptote version: // discontf.asy // // run // asy discontf.asy // to get a standalone discontf.pdf // settings.outformat="pdf"; import graph; import math; import fontsize;defaultpen(fontsize(8pt)); texpreamble("\usepackage{lmodern}"+"\usepackage{amsmath}" +"\usepackage{amsfonts}"+"\usepackage{amssymb}"...

2

Replace \begin{minipage}[b][5cm][s]{.45\textwidth} with \begin{minipage}[t]{.45\textwidth} and remove all \vfill commands to get the following result: \documentclass{achemso} \usepackage{tikz} \title{title} \usepackage{lipsum} % Only for dummy text. Do not use in actual document. \begin{document} \begin{figure} \centering \begin{minipage}[t]{.45\...

Only top voted, non community-wiki answers of a minimum length are eligible