Hot answers tagged

10

Like this: for positions of dots are used corners of regular shape from the library shapes.geometric dots and connection lines are drawn in the loops labels of dots are defined with counters in the loop \documentclass[tikz, border=3mm]{standalone} \usetikzlibrary{shapes.geometric} \tikzset{ dot/.style = {circle, inner sep=1pt, fill, node ...


9

What I get is an error, actually. When plotting a function of x you should do \addplot {<function>}; or \addplot [<option>] {<function>}; if you're adding any options to the plot. You have done just \addplot [...] <function>; without the {}. In addition, note that multiplication has to be specified explicitly with *, so you need \...


8

You are not far. You need some clipping with respect to the x values via the fill between[soft clip={domain=\xa:\xb}]; command for the green area. For the red and blue areas, you also have to use the fillbetween library with the top and bottom horizontal axes, hence \path[name path=baxis] (axis cs:0,0) -- (axis cs:1,0); and \path[name path=taxis] (axis cs:0,...


6

Maybe you'll like: \documentclass[tikz, margin=3mm]{standalone} \usetikzlibrary{angles, arrows.meta, quotes} \begin{document} \begin{tikzpicture}[ > = Stealth, every node/.append style = {font=\small, text=black, fill=white, fill opacity=0.5, text opacity=1, inner sep=1pt}, my angle/....


5

The first one is a nice one to do with random path angles in Metapost. This is wrapped up in luamplib, so to compile it in Overleaf, you will need to pick the lualatex option in the menu. \documentclass[border=5mm]{standalone} \usepackage{luamplib} \begin{document} \mplibtextextlabel{enable} \begin{mplibcode} beginfig(1); path xx, tt; xx = (left -- ...


5

Since I don't know how to use the graphs library of TikZ, here is an example of what you can do simply with coordinates: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \newcommand{\biglength}{5} \newcommand{\smalllength}{2} \draw (0, 0) ...


4

With Asymptote, http://asymptote.ualberta.ca/ import graph; size(6cm,5cm,false); real f(real x){return 0.3809462-3.501616*x+59.02336*x^2-252.9963*x^3 + 359.5232*x^4;} real g(real x){return -2.377416+44.36774*x-182.5977*x^2+333.9887*x^3 - 225.183*x^4;} real h(real x){return (x^2)/((1-x)*(0.01863372893)+x^2*0.5);} fill(graph(h,0,0.5)--(0.5,0)--cycle,red); ...


4

Make the following edit in your code-- \draw (sr) to [bend right=90,looseness=1.5] (r); \draw (sr2) to [bend right=-90,looseness=1.5](r);


4

If your work involves mathematics and/or programming you should investigate the sagetex package, located here on CTAN. This gives you access to a computer algebra system, called SAGE, as well as the Python programming language. SAGE is not part of a LaTeX installation. You can get up and running in 5 minutes by creating a free online Cocalc account. Another ...


4

For compare purpose. Compile with Ahihi đồ ngốc.(please don't fix it) or http://asymptote.ualberta.ca/ size(7cm); pair[] P,Q,T; for (int i=0; i<5;++i){ P.push(dir(90-i*72)); Q.push(2/3*dir(90-i*72)); T.push(1/3*dir(90-i*72)); } P.cyclic=true; T.cyclic=true; for (int i=0; i<P.length;++i){ label(scale(0.6)*Label("$"+(string) (i+1) +&...


4

A simple approach for you to start with, it defines a node style mynodes that can be used later. Then you can draw nodes at various locations, e.g. in a polar coordinate system, where the first value is the angle and the second the distance. Then in the end you can \draw from any node to any node. Here is my start for you, but as I didn't find a systematic ...


3

Just use extra x ticks with a dedicated style extra x tick style that shifts it to the right. extra x ticks={20}, extra x tick style={xshift=6pt}, \documentclass[12pt]{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \pgfplotsset{ every mark/.append style={mark size=0.5pt}, grid, grid style={dashed, draw=gray!10}, legend image with text/....


3

You can use the axis on top=true option like this: \documentclass[12pt]{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \pgfplotsset{ every mark/.append style={mark size=0.5pt}, grid, grid style={dashed, draw=gray!10}, legend image with text/.style={ legend image code/.code={% \node[anchor=center] at (0.3cm,0cm) {#1}; ...


2

A rough version. Draw in pic and manage style by pgfkeys \documentclass[tikz, border=1cm]{standalone} \pgfdeclarelayer{left} \pgfdeclarelayer{right} \pgfdeclarelayer{plot} \pgfsetlayers{main, right, left, plot} \tikzset{ pics/riemann sum/.style args={#1:#2:#3}{ code={ \pgfmathsetmacro{\leftpoint}{#1} \pgfmathsetmacro{\rightpoint}{#2} ...


2

% Edited from --The seven bridges of Königsberg at http://mirror.iopb.res.in/tex-archive/obsolete/macros/latex/contrib/tkz/tkz-graph/doc/tkz-graph-screen.pdf % Author : Alain Matthes % Encoding : UTF8 % Engine : PDFLaTeX \documentclass[]{article} \usepackage[utf8]{inputenc} \usepackage{fullpage} \usepackage{fourier} \usepackage{tikz} \usetikzlibrary{arrows,...


2

This can be done using the package tikz. The following code shows how you can draw (any) graph using this package. \documentclass[12pt]{report} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw [gray,dotted] (0,-6) grid (10,7) ; \draw[->,>=latex] (0,0) -- (10,0) node[below]{$s$} ; \draw[->,>=latex] (0,-6) -- (0,7) node[left]{$...


1

like this? \begin{tikzpicture} \draw (0,0) .. controls (1.5,1.5) and (2.3,3) .. (3,3) .. controls (4,3) and (4,3) .. (5,3) .. controls (5.5,3) and (6.6,1) .. (7,1) .. controls (7.5,1) and (7.5,1) .. (8,1); \end{tikzpicture} Change (2.3,3) to (2.5,3) and see the result. this makes it more flatten if you want.


1

In the following example, I have used width=\columnwidth to make sure the graph is as wide as one column in a twocolumn document. Additionally, I have use siunitx in order to avoid repetitive code in the table: \documentclass[twocolumn]{article} \usepackage{tabularx} \usepackage{tikz, pgfplots} \usepackage{showframe} \usepackage{lipsum} \usepackage{siunitx} ...


1

I can think of two possible solutions: Solution 1 You could replace the -- with to which accepts extra options like an angle at which the path should leave from its origin and also at which the path should arrive at its destination. In your case, you would replace \draw (sr) -- (r); \draw (sr2) -- (r); with \draw (sr) to [in = 90, out = 135] (r); \draw (...


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