Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [pattern]

about defining or using graphical patterns, which can be used to fill a path. PDF and PostScript know tiling and shading patterns. Patterns are supported by [tag:tikz-pgf] and [tag:pstricks].

1
vote
1answer
65 views

Grid in pattern in TikZ

Referring to the answer in How do I fill this area with inclined parallel lines , the pattern is generated with grid lines as well. I am not able to understand the behavior. \documentclass{article} \...
3
votes
1answer
47 views

Hatch direction

I want to modify the hatch lines direction marked in red of the next diagram: It was obtained with the next code: \documentclass[letterpaper,11pt]{report} \usepackage[utf8]{inputenc} \usepackage{...
3
votes
1answer
73 views

TikZ: How to clip out random coil fragments?

Based on this answer from marmot I am thinking about how to design a turbulent flow regime along a stream line within coarsed soil. Minimum Working Example (MWE): \documentclass[border=5mm]{...
1
vote
0answers
27 views

TikZ: How to add fill in style of multiple arcs?

I want to visualize poured loose coarse soil. Minimum Working Example (MWE): \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw (0, 0) rectangle (4, 4); \...
9
votes
2answers
357 views

TikZ: How to fill area with a special pattern?

I want to visualize a turbulent flow regime. Assumed we have a simple empty square that should be filled with a pattern. Minimum Working Example (MWE): \documentclass{standalone} \usepackage{tikz} \...
4
votes
1answer
55 views

pattern=grid, how to simple increase grid steps

i have the following mwe: \documentclass[tikz, margin=3]{standalone} \usetikzlibrary{patterns} \begin{document} \begin{tikzpicture}[pattern color=gray!50] \node (s) [draw=gray!50, thick, ...
0
votes
1answer
89 views

Tikz custom dotted pattern

I have no idea for reducing distance of dots (lines) in tikz dotted (horizontal lines) pattern. I find some similar examples in this website (like this), but it was so complicated. Can someone give ...
3
votes
2answers
182 views

How to add patterns inside shapes bounded by curves?

It is easy to use patterns for nice shapes like rectangle. How to fill an area by patterns enclosed by some curves? For example I have trouble with adding pattern to the following between two arcs: \...
2
votes
1answer
66 views

A colored pattern but a little change to the random function in TikZ is required

Consider the following MWE: \documentclass[border=0pt,tikz]{standalone} \definecolor{elila}{RGB}{186,85,211} \definecolor{zlila}{RGB}{138,43,226} \definecolor{dblau}{RGB}{30,144,255} \definecolor{...
1
vote
2answers
84 views

Color error by using tikz

My tags are follows: \documentclass{book} \usepackage{tikz,amsmath,caption,subcaption} \usetikzlibrary{arrows,patterns} %\usepackage{fullpage,varwidth} \tikzset{transform shape} \usetikzlibrary{...
11
votes
1answer
189 views

Tikz: custom text as fill pattern for shapes

I am looking for an option to will an arbitrary shape (box, circle or something defined via fit library) with custom text. For example instead of filling it with dots as here \documentclass[10pt]{...
6
votes
1answer
107 views

Plot bar chart from csv with different styles depending on row in csv

I try to plot the content of a csv file in a bar chart, where depending on the row the bar should have a different style. This is what I came up with so far: \documentclass{article} \usepackage{tikz} ...
2
votes
1answer
50 views

How to i get this filling patern?

How do we get this 3d efect on the rectangle uzing tikz?
2
votes
0answers
34 views

Separated Pie Slice Styles

I refer to the question discussed: Fractions inside the pieces Now, I could not find out two more things: (1): How to label selected pie slices? The option /tikz/nodes={text opacity=0, overlay} ...
2
votes
1answer
219 views

Is there a simpler way to control pattern density?

Desired output: Here is an MWE which achieves exactly that: \documentclass[11pt]{article} \usepackage{tikz} \usetikzlibrary{calc,intersections,through,backgrounds,matrix,patterns} \usepackage{...
11
votes
1answer
264 views

Tikz pattern size in spy

I have a problem using pattern to fill shapes: I've a shape thats filled with a self-defined pattern (simple dots with the same distance) and i want to zoom at one corner of the shape. I do this with ...
6
votes
2answers
261 views

Venn Diagrams and Patterns

As a teacher, I really appreciate the venndiagram usepackage with its functionality. Is there a way to fill the sets with patterns instead of a solid color (for better printing)? Something along the ...
3
votes
2answers
802 views

Changing density of pattern in TikZ

I was redrawing a picture with TikZ and here is the original: I don't have any problems to draw this, but as you can see in my MWE, I've just scopped some areas to make manually a pattern which have ...
12
votes
2answers
808 views

“Water–pattern”: a mechanical system

I was reading an old book and I found a picture which I reproduced with TikZ. Here is the original: And here is my attempt and a MWE: \documentclass[border=5pt,tikz]{standalone} \usetikzlibrary{...
6
votes
2answers
133 views

Bleed pattern if more than the half is drawn

I want to draw an invisible big circle filled with small visible circles. If more than a half of a small circle fits in the big circle, it should be plotted (even if it is outside the big circle. ...
1
vote
1answer
46 views

A random pattern with predefined style

I would like to create the following picture with TikZ. But I have no idea how to do this mathematically; for example, saying that if that condition is met, the rectangle, corresponding to the image, ...
5
votes
1answer
105 views

Clipping at node – making a pattern

I want to add a pattern to a node in TikZ; how can I, for example, fill in the number 5 with the numbers 5 (ie a picture in a picture ...)? Here is my MWE: \documentclass[border=5pt,tikz]{standalone}...
0
votes
0answers
54 views

LyX preview with TikZ patterns

I'm not sure if I'm doing something wrong or if I've found a bug in LyX, but its preview feature is just completely breaking when I try to use the patterns TikZ library. It does produce the correct ...
1
vote
2answers
117 views

Pgfplot, new dash pattern with star?

Pgfplots use only dots in the pattern (dashdotted, dashdotdotted). If I use mark option the marks do not seem to compatible with the rest of the line. Is it possible to use star (suitably sized) or ...
2
votes
1answer
81 views

Crosshatch pattern in table of contents

In his TeXbook, Donald Knuth creates a very beautiful crosshatch pattern for the leaders in the Table on Contents. I tried mimicking it with the package tocloft, using an complicated scheme of an ...
2
votes
0answers
77 views

Can't move starting point of rectangle [closed]

I want to draw a rectangle which starts in these coordinates: from northwest(3,0) to southeast(4,-2). Here is the code: \documentclass[11pt,a4paper,oneside]{article} \usepackage{amsmath} \usepackage{...
7
votes
2answers
439 views

How to create a twocolored checkerboard pattern with tikz?

I want to create a checkerboard pattern with two colors. Is there a possibility to do this inside a pattern definition? I found a node-based solution (first print the background, then add the ...
17
votes
3answers
385 views

wood pattern with metapost

I need to draw few diagrams like this with MetaPost. So I want to create a wood-pattern-filling-function and use it few times. Is there a good way to do it? I think to generate a random function, ...
3
votes
1answer
71 views

How to define a variable with space for tikz?

I create a pattern and want to change the lines' density when I invoke this pattern. What I have got for now: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{patterns} \newdimen\density ...
12
votes
2answers
598 views

TikZ: How to draw a pattern at the border of a tikz path

I want to draw the shapes of airspaces according to the german VFR map style and I have problems with the restricted areas, ED-R44 in this picture: I already found out how to do the airspace A and B,...
5
votes
2answers
2k views

Confusion matrix in LaTeX

I used the proposed example in the "confusion matrix using only LaTeX code" I increased the number of classes and until 9x9 confusion matrix, everything worked very well, but for 10 or higher numbers ...
5
votes
1answer
90 views

Tikz efficiency, Joule expansion diagram

I was trying to draw the well-know Joule expansion experiment in Tikz, and I managed to get through it thanks to many (many) other topics. However, it seems to by quite slow, as it takes 10 seconds ...
4
votes
2answers
347 views

Tikz : rotate a fill pattern

For bw printing, I'd like to rotate the filling pattern. How to do this ? \documentclass[margin=2pt]{standalone} \usepackage{tikz,siunitx} \usetikzlibrary{% calc, intersections, patterns} ...
3
votes
1answer
125 views

drawing discontinuous lines when using `\filldraw`

My goal was drawing a 90° section of a torus filled with some pattern (dots in this case), such that only the inside and the outside border of the torus are solid lines, but not the artificial lines ...
4
votes
1answer
340 views

How to hatch pie charts in Tikz pgf?

I am trying to implement Bordaigorl's answer to create pie charts with patterns. However, with my MWE I get the following errors: Package pgfkeys Error: I do not know the key '/tikz/slice type/....
5
votes
2answers
1k views

Hatched rectangle with color gradient

Is it possible in tikz to draw a hatched rectangle, in which the hatching color(NOT fill color) has a gradient (changes from red(say) from one side to the blue to the other side)? \draw[pattern=...
1
vote
1answer
397 views

How to set the color of an horizontal bar chart?

I am trying to make a violet horizontal bar chart. So far I managed to make a violet outline with a blue filling, but when I try to get a violet filling Latex compilation fails. Here is an example ...
1
vote
0answers
80 views

Slanting a square together with its pattern

I want to draw a cube in which all sides are filled with bricks. My code is based on the slanting of sides but unfortunately bricks remain straight and the figure won't be nice. Here is my code: \...
6
votes
1answer
563 views

Filling a form having different line styles with a pattern

I want to make a small technical drawing in tikz. Cuts in technical drawings are shown with a handwritten line which is realized with the "pencildraw" (derived from another question here). The rest ...
9
votes
2answers
333 views

Drawing C. elegans germline in Tikz

I am trying to draw C. elegans germline using TikZ. I have used Philippe Goutet's / script to create "hexagon with filled round circles" The codes are \documentclass[11pt]{article} \usepackage{tikz,...
1
vote
1answer
212 views

How to use hatch pattern in baposter header box?

I'd like to try using hatch in my header box or box background within baposter. With the template I'm using, you can only input headerColorOne, and can't dictate pattern or fill. How would I go about ...
1
vote
0answers
139 views

Custom fill pattern in a gradient

I'm fairly new to tikz, so I might have missed how to do this, but I wasn't sure how to look for it. I'm trying to redraw the figure below: I can build most of the figure with no problem, but I'm not ...
6
votes
2answers
815 views

Filling a path with a color and a pattern simultaneously

I would like a rectangle with the following style: \usepackage{tikz} \usetikzlibrary{patterns} \begin{document} \begin{tikzpicture} \path[fill=gray,pattern=bricks] (0,0) rectangle (5,-1); \end{...
3
votes
1answer
66 views

Is it possible to assign patterns to certain nodepart elements?

It is possible to assign color to individual nodepart elements. \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{shapes,patterns} \begin{document} \begin{tikzpicture}[stack/.style={ ...
2
votes
0answers
238 views

Hatching Density [duplicate]

I want to hatch a certain area using tikz's pattern library. Here is what I currently have: \begin{tikzpicture} \draw{(0,1.5) -- ++(0, -3)}; \fill[pattern = north east lines, pattern color = ...
1
vote
1answer
694 views

Tikz Pgfplots - Create legend from bar chart with Stripes

I have a problem trying to create the legend for my bar chart with stripes. I would like to create a legend showing rectangles with stripes for each bar, like it is presented in the pic. The code ...
1
vote
1answer
211 views

Filling pattern between two path without axis

I want to fill between two paths I created with a pattern. When I do so, the filling is always black. I would like other colors/patterns. My MWE is : \documentclass[a4paper,12pt,twoside]{book} \...
0
votes
0answers
42 views

Overriding built-in TikZ styles (name collisions?)

A comment on my last question pointed out that I should avoid using style names that are already declared in TikZ, and I read the manual but it was somewhat vague on the side-effects of not doing this....
1
vote
1answer
398 views

Patterned legend in caption

This is a follow-up question of: latex - colorbox in caption as legend - how to center or alternative solution? For convenient sake, I copy the MWE: \documentclass{article} \usepackage{graphicx} \...
3
votes
1answer
1k views

How to change the density of a pattern?

I want to use the crosshatch dots pattern but in my eyes the density of the dots is too high. This means the distance between the dots is too small for me. I already know that I have to define my own ...