Tag Info

Hot answers tagged

18

Squiggle The following example draws the squiggle with randomness in the polar coordinate system. It draws twelve circles with 500 points. Each point is specified as polar coordinates. The radius is allowed in the range half to one and a half radius. The angle can up to ten degrees in the forward or backward direction. Changing the parameters allow the ...


13

This doesn't use Tikz, but here is a solution in asymptote. unitsize(1inch); int numPoints = 150; path p; for (int i = 0; i < numPoints; ++i) { p = p..dir(i*360.0/numPoints)+scale(0.25)*(unitrand()-0.5, unitrand()-0.5); } p = p..cycle; dot((0,0), 4+black); draw(unitcircle, 1+green); draw(p); dot(p, 2+red);


11

Measurements The English Wikipedia article says: The ratio of the width of the flag to the height of the flag to a side of the white square should be 3 to 2 to 1. The ratio of a side of the white square to the radius of a circle enclosing the star should be 10 to 3.5. If the width of the flag is 3 units, then the diameter of the ...


10

Just for fun, adding the TV set: \documentclass[border=10pt]{standalone} \usepackage{tikz} \definecolor{c11}{HTML}{C1BFC2} \definecolor{c12}{HTML}{C0BF02} \definecolor{c13}{HTML}{00C0C1} \definecolor{c14}{HTML}{02BF01} \definecolor{c15}{HTML}{BF00C0} \definecolor{c16}{HTML}{C10001} \definecolor{c17}{HTML}{0100C2} \definecolor{c21}{HTML}{0300C3} ...


9

Two options. Clipping a circle using the rays: \begin{scope} \clip (B) -- (A) -- (C); \path[draw] let \p1=( $ (A) - (P) $ ) in (A) circle ({veclen(\x1,\y1)}); \end{scope} using the angles library: \path[draw] let \p1=( $ (A) - (P) $ ) in pic[draw,angle radius={veclen(\x1,\y1)}] {angle = C--A--B}; \end{tikzpicture} In both cases, the ...


9

Here is one possible TikZ solution : \documentclass[tikz,border=7mm]{standalone} \usetikzlibrary{calc} \begin{document} % create \n random points around the circle with radious 5 \def\n{50} \xdef\pts{} \foreach \i in {1,...,\n}{ \xdef\pts{\pts ({\i/\n*360}:{5+rnd})} } \begin{tikzpicture} %draw random curve with some tension ...


9

Some comments : xcolor is loaded by tikz, so don't reload it again, use capitals in color numbers, your last rectangle overlap the previous ones, you can make it shorter using foreach. Here is the code : \documentclass[tikz]{standalone} \definecolor{rot}{HTML}{E40303} \definecolor{xorange}{HTML}{FF8C00} \definecolor{gelb}{HTML}{FFED00} ...


8

The previous color is overwritten by the next larger rectangle, probably you want something like: \documentclass[tikz]{standalone} \definecolor{lila}{HTML}{8800bb} \definecolor{blau}{HTML}{0000FF} \definecolor{hellblau}{HTML}{88bbdd} \definecolor{gruen}{HTML}{66bb44} \definecolor{gelb}{HTML}{FFee00} \definecolor{orange}{HTML}{FF4411} ...


8

One option: The idea is to use a tikzpicture and \nodes with the proper settings to place the elements at the desired locations; since internal calculations are involved, two runs are needed for the elements to appear at their final locations. Feel free to adjust the settings according to your needs. The code: \documentclass[11pt, landscape]{memoir} ...


7

The spiral can be drawn by a parameterized plot coordinate. The example uses a 3D coordinate system, the z axis is tilted 30° down. The origin is the center point of the bottom circle. The curves are drawn via plot and variable \t, which specifies the angle. The x coordinate is calculated by cos(\t)*\cylrad with \cylrad as cylinder radius. The z ...


7

This is fairly close. Scaling with scale will work, but changing the x and y unit vectors will not work, as the size of the star is defined in centimeters. According to https://en.wikipedia.org/wiki/Esperanto_symbols the ratio of the radius of the star to a side of the white square should be 3.5/10. As minimum size defines the diameter, I scaled by 7/10. ...


7

Updated version I just noticed that the filling for the bananas is done using different shades of gray: The code: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}[>=latex] \coordinate (A) at (0,0) ; \coordinate (B) at (0,-5) ; \coordinate (C) at (4,0) ; \coordinate (D) at (4,-5) ; \filldraw[top color=gray!20,bottom ...


6

An imperfect starting point without schemabloc... \documentclass[tikz,border=5]{standalone} \usetikzlibrary{positioning,arrows.meta,calc} \tikzset{ block/.style={ shape=rectangle, fill=white, draw=black, minimum width=1.25cm, minimum height=0.75cm, label=above:\strut#1 }, sum/.style args={+ #1 - #2}{ shape=circle, ...


6

The problem is that \pgfmathsetmacro\ppq{\q-2}; set \ppq to 2.0 and (q2.0) is not the same as (q2). To avoid this you can use \pgfmathsetmacro\ppq{int(\q-2)}; or even better \pgfmathtruncatemacro\ppq{\q-2}; (as suggested by @percusse in the comment). Here is an example of code (not exactly the same as yours): \documentclass[tikz,border=7mm]{standalone} ...


6

The symbols can be drawn with TikZ, see the answer of Gonzalo Medina. The following example uses the symbols of package pifont together with package pdfrender for coloring (requires pdfTeX). \documentclass{article} \usepackage{tikz} \usetikzlibrary{plotmarks} \usepackage{graphicx} \usepackage{pdfrender} \usepackage{pifont} \newcommand*{\MarkSymbol}[3]{% ...


6

Something like that? The main problem with your code is the redefinition of circle which calls circle. I replaced it by my circle. For the elements, I used absolute positioning which is not so elegant, but allows all degrees of freedom. \documentclass[border=10pt]{standalone} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{shapes,arrows} ...


6

The main constructs are \foreach and grid; the shapes.geometric library was used for the stars and the diamonds: The code: \documentclass{article} \usepackage{amssymb} \usepackage{tikz} \usetikzlibrary{shapes.geometric} \definecolor{myred}{RGB}{236,1,59} \definecolor{myblue}{RGB}{116,122,255} \definecolor{mygreen}{RGB}{130,214,149} ...


5

Just change the drawing order: First ellipse Gray area Second and third ellipses and text nodes. Further remarks: Multi-line text is enabled by node option align. light-gray is a little an unhappy color name because of the hyphen. When the shorthand notation \fill[light-gray] is used, TikZ misinterprets the hyphen as arrow specification, when the ...


5

In case you would like the flag to fly... \documentclass[tikz, border=5pt]{standalone} \usetikzlibrary{shapes.symbols,positioning} \definecolor{rot}{HTML}{e40303} \definecolor{xorange}{HTML}{FF8c00} \definecolor{gelb}{HTML}{FFed00} \definecolor{gruen}{HTML}{008026} \definecolor{blau}{HTML}{004dFF} \definecolor{lilla}{HTML}{750787} \begin{document} ...


5

The package tikzscale delays its redefinition of \includegraphics at begin document, so you should do \AtBeginDocument{% \renewcommand{\includegraphics}[2][]{% \setlength{\fboxsep}{-\fboxrule}% \framebox{\rule{0pt}{0.6\linewidth}\rule{\linewidth}{0pt}}% }% } as well.


5

This is the Tikz plot: Here is a PStricks version: \documentclass{article} \usepackage{pst-plot} \begin{document} \psset{unit=0.5cm} \begin{pspicture}(12,14) \psgrid[gridcolor=red,subgridcolor=green,gridlabels=0,subgriddiv=4,gridwidth=.4pt,unit=2](0,0)(5,6) \psaxes[Dx=2,Dy=4,showorigin=false]{->}(0,0)(0,0)(11,13) \psplot{0.5}{9.5}{36 x mul ...


4

Here's a starting point using pgfplots and its fillbetween library: The code: \documentclass{article} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} \pgfmathdeclarefunction{gauss}{3}{% \pgfmathparse{1/(#3*sqrt(2*pi))*exp(-((#1-#2)^2)/(2*#3^2))}% } \begin{document} \begin{tikzpicture} \begin{axis}[ no markers, domain=0:7, samples=150, ...


4

Here is a simplified code with 4 marked angles : \documentclass[tikz,border=7mm]{standalone} \usetikzlibrary{angles} \begin{document} \begin{tikzpicture}[xslant=1,xscale=3,scale=2] \draw (0,0) rectangle (1,1) coordinate(C) node[above]{C} -- (0,0) coordinate(A) node[below]{A} (1,0) coordinate(D) node[below]{D} -- (0,1) ...


4

I would guess you are referring to the parabola's resolution. Then, just replace samples=50 with samples=501 or similar.


4

You can try with a matrix which serve as filled background nodes while inner nodes are drawn or filled according your taste. \documentclass[tikz, border=2mm]{standalone} \usetikzlibrary{matrix} \begin{document} \begin{tikzpicture}[field/.style={draw, fill=white, minimum height=1cm, text width= 5cm, align=left}] \matrix (card) [matrix of ...


4

A solution via a table with the advantage that the width is set automatically to the needed space: \documentclass{article} \usepackage{array} \usepackage{booktabs} \usepackage[table]{xcolor} \begin{document} \setlength{\fboxrule}{1pt} \setlength{\fboxsep}{\tabcolsep} \setlength{\arrayrulewidth}{1pt} \fcolorbox{black}{lightgray}{% ...


4

Another way with TikZ, where the structure is built manually. Wrapped it in a macro for convenience, the width of the second column is set to that of the widest entry in the column. \documentclass[border=3mm]{standalone} \usepackage{tikz} \usetikzlibrary{positioning,fit,backgrounds} \newcommand\someboxthingy[3]{ ...


4

I am not sure if I understood correctly. Something like this? The code: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}[x=7mm] \draw[<->] (-6,0) -- (6,0); \foreach \x in {-5,...,5} { \draw[shift={(\x,0)}] (0pt,3pt) -- (0pt,-3pt) node[below,font=\small] {$\x$}; } \node[below] at (-5.8,-5pt) {$\cdots$}; ...


4

Before showing the results, some notes This answer will only cover your first graph. Reason being that the code for it is already long and it took a while. Also the first graph is incomplete. The blue and green arrows are missing, and I'm not sure if you wanted them to follow the intersection between the marker and the sin waves while being constrained in ...


4

Here is one suggestion. Instead of using scopes and shifting those around, I place one of the lower nodes of the two automata on the sides relative to the closest of the lower nodes on the center one. The rectangles are drawn afterwards with the help of the fit library. Other remarks: I've changed from of= to =of, and loaded the positioning library. This ...



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