Skip to content

Commit 7b55c39

Browse files
authored
Merge branch 'master' into master
2 parents 694ac57 + ee3075c commit 7b55c39

15 files changed

+475
-152
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[flake8]
22
ignore = E203, E266, E501, W503
3-
max-line-length = 80
3+
max-line-length = 88
44
max-complexity = 20
55
select = B,C,E,F,W,T4,B9

test/test_arrows_reference.tex

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@
1212
ymin=0, ymax=7.5,
1313
ytick style={color=black}
1414
]
15-
\draw[fill=color0,draw opacity=0] (axis cs:3.2,6.8) circle (0.2);
16-
\draw[fill=color0,draw opacity=0] (axis cs:3.2,5.8) circle (0.2);
17-
\draw[fill=color0,draw opacity=0] (axis cs:3.2,4.8) circle (0.2);
18-
\draw[fill=color0,draw opacity=0] (axis cs:3.2,3.8) circle (0.2);
19-
\draw[fill=color0,draw opacity=0] (axis cs:3.2,2.8) circle (0.2);
20-
\draw[fill=color0,draw opacity=0] (axis cs:3.2,1.8) circle (0.2);
21-
\draw[fill=color0,draw opacity=0] (axis cs:3.2,0.8) circle (0.2);
22-
\draw[fill=color0,draw opacity=0] (axis cs:7.2,6.8) circle (0.2);
23-
\draw[fill=color0,draw opacity=0] (axis cs:7.2,5.8) circle (0.2);
24-
\draw[fill=color0,draw opacity=0] (axis cs:7.2,4.8) circle (0.2);
25-
\draw[fill=color0,draw opacity=0] (axis cs:7.2,3.8) circle (0.2);
26-
\draw[fill=color0,draw opacity=0] (axis cs:7.2,2.8) circle (0.2);
27-
\draw[fill=color0,draw opacity=0] (axis cs:7.2,1.8) circle (0.2);
28-
\draw[fill=color0,draw opacity=0] (axis cs:7.2,0.8) circle (0.2);
15+
\draw[draw=none,fill=color0] (axis cs:3.2,6.8) circle (0.2);
16+
\draw[draw=none,fill=color0] (axis cs:3.2,5.8) circle (0.2);
17+
\draw[draw=none,fill=color0] (axis cs:3.2,4.8) circle (0.2);
18+
\draw[draw=none,fill=color0] (axis cs:3.2,3.8) circle (0.2);
19+
\draw[draw=none,fill=color0] (axis cs:3.2,2.8) circle (0.2);
20+
\draw[draw=none,fill=color0] (axis cs:3.2,1.8) circle (0.2);
21+
\draw[draw=none,fill=color0] (axis cs:3.2,0.8) circle (0.2);
22+
\draw[draw=none,fill=color0] (axis cs:7.2,6.8) circle (0.2);
23+
\draw[draw=none,fill=color0] (axis cs:7.2,5.8) circle (0.2);
24+
\draw[draw=none,fill=color0] (axis cs:7.2,4.8) circle (0.2);
25+
\draw[draw=none,fill=color0] (axis cs:7.2,3.8) circle (0.2);
26+
\draw[draw=none,fill=color0] (axis cs:7.2,2.8) circle (0.2);
27+
\draw[draw=none,fill=color0] (axis cs:7.2,1.8) circle (0.2);
28+
\draw[draw=none,fill=color0] (axis cs:7.2,0.8) circle (0.2);
2929
\draw[-,black] (axis cs:2,6.8) -- (axis cs:3.2,6.8);
3030
\node at (axis cs:2,6.8)[
3131
scale=0.7,

test/test_axvline_reference.tex

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,36 @@
1212
ymin=-1, ymax=1,
1313
ytick style={color=black}
1414
]
15-
\draw[fill=color0,draw opacity=0] (axis cs:-2.42667924339307,0) rectangle (axis cs:-2.29074205071007,1);
16-
\draw[fill=color0,draw opacity=0] (axis cs:-2.29074205071007,0) rectangle (axis cs:-2.15480485802706,0);
17-
\draw[fill=color0,draw opacity=0] (axis cs:-2.15480485802706,0) rectangle (axis cs:-2.01886766534405,0);
18-
\draw[fill=color0,draw opacity=0] (axis cs:-2.01886766534405,0) rectangle (axis cs:-1.88293047266104,0);
19-
\draw[fill=color0,draw opacity=0] (axis cs:-1.88293047266104,0) rectangle (axis cs:-1.74699327997804,0);
20-
\draw[fill=color0,draw opacity=0] (axis cs:-1.74699327997804,0) rectangle (axis cs:-1.61105608729503,0);
21-
\draw[fill=color0,draw opacity=0] (axis cs:-1.61105608729503,0) rectangle (axis cs:-1.47511889461202,1);
22-
\draw[fill=color0,draw opacity=0] (axis cs:-1.47511889461202,0) rectangle (axis cs:-1.33918170192901,0);
23-
\draw[fill=color0,draw opacity=0] (axis cs:-1.33918170192901,0) rectangle (axis cs:-1.20324450924601,0);
24-
\draw[fill=color0,draw opacity=0] (axis cs:-1.20324450924601,0) rectangle (axis cs:-1.067307316563,1);
25-
\draw[fill=color0,draw opacity=0] (axis cs:-1.067307316563,0) rectangle (axis cs:-0.931370123879991,0);
26-
\draw[fill=color0,draw opacity=0] (axis cs:-0.931370123879991,0) rectangle (axis cs:-0.795432931196984,1);
27-
\draw[fill=color0,draw opacity=0] (axis cs:-0.795432931196984,0) rectangle (axis cs:-0.659495738513976,0);
28-
\draw[fill=color0,draw opacity=0] (axis cs:-0.659495738513976,0) rectangle (axis cs:-0.523558545830969,1);
29-
\draw[fill=color0,draw opacity=0] (axis cs:-0.523558545830969,0) rectangle (axis cs:-0.387621353147961,1);
30-
\draw[fill=color0,draw opacity=0] (axis cs:-0.387621353147961,0) rectangle (axis cs:-0.251684160464954,0);
31-
\draw[fill=color0,draw opacity=0] (axis cs:-0.251684160464954,0) rectangle (axis cs:-0.115746967781946,0);
32-
\draw[fill=color0,draw opacity=0] (axis cs:-0.115746967781946,0) rectangle (axis cs:0.0201902249010613,0);
33-
\draw[fill=color0,draw opacity=0] (axis cs:0.0201902249010613,0) rectangle (axis cs:0.156127417584069,0);
34-
\draw[fill=color0,draw opacity=0] (axis cs:0.156127417584069,0) rectangle (axis cs:0.292064610267076,1);
35-
\draw[fill=color0,draw opacity=0] (axis cs:0.292064610267076,0) rectangle (axis cs:0.428001802950084,0);
36-
\draw[fill=color0,draw opacity=0] (axis cs:0.428001802950084,0) rectangle (axis cs:0.563938995633091,0);
37-
\draw[fill=color0,draw opacity=0] (axis cs:0.563938995633091,0) rectangle (axis cs:0.699876188316099,0);
38-
\draw[fill=color0,draw opacity=0] (axis cs:0.699876188316099,0) rectangle (axis cs:0.835813380999106,0);
39-
\draw[fill=color0,draw opacity=0] (axis cs:0.835813380999106,0) rectangle (axis cs:0.971750573682114,0);
40-
\draw[fill=color0,draw opacity=0] (axis cs:0.971750573682114,0) rectangle (axis cs:1.10768776636512,1);
41-
\draw[fill=color0,draw opacity=0] (axis cs:1.10768776636512,0) rectangle (axis cs:1.24362495904813,0);
42-
\draw[fill=color0,draw opacity=0] (axis cs:1.24362495904813,0) rectangle (axis cs:1.37956215173114,1);
43-
\draw[fill=color0,draw opacity=0] (axis cs:1.37956215173114,0) rectangle (axis cs:1.51549934441414,0);
44-
\draw[fill=color0,draw opacity=0] (axis cs:1.51549934441414,0) rectangle (axis cs:1.65143653709715,1);
15+
\draw[draw=none,fill=color0] (axis cs:-2.42667924339307,0) rectangle (axis cs:-2.29074205071007,1);
16+
\draw[draw=none,fill=color0] (axis cs:-2.29074205071007,0) rectangle (axis cs:-2.15480485802706,0);
17+
\draw[draw=none,fill=color0] (axis cs:-2.15480485802706,0) rectangle (axis cs:-2.01886766534405,0);
18+
\draw[draw=none,fill=color0] (axis cs:-2.01886766534405,0) rectangle (axis cs:-1.88293047266104,0);
19+
\draw[draw=none,fill=color0] (axis cs:-1.88293047266104,0) rectangle (axis cs:-1.74699327997804,0);
20+
\draw[draw=none,fill=color0] (axis cs:-1.74699327997804,0) rectangle (axis cs:-1.61105608729503,0);
21+
\draw[draw=none,fill=color0] (axis cs:-1.61105608729503,0) rectangle (axis cs:-1.47511889461202,1);
22+
\draw[draw=none,fill=color0] (axis cs:-1.47511889461202,0) rectangle (axis cs:-1.33918170192901,0);
23+
\draw[draw=none,fill=color0] (axis cs:-1.33918170192901,0) rectangle (axis cs:-1.20324450924601,0);
24+
\draw[draw=none,fill=color0] (axis cs:-1.20324450924601,0) rectangle (axis cs:-1.067307316563,1);
25+
\draw[draw=none,fill=color0] (axis cs:-1.067307316563,0) rectangle (axis cs:-0.931370123879991,0);
26+
\draw[draw=none,fill=color0] (axis cs:-0.931370123879991,0) rectangle (axis cs:-0.795432931196984,1);
27+
\draw[draw=none,fill=color0] (axis cs:-0.795432931196984,0) rectangle (axis cs:-0.659495738513976,0);
28+
\draw[draw=none,fill=color0] (axis cs:-0.659495738513976,0) rectangle (axis cs:-0.523558545830969,1);
29+
\draw[draw=none,fill=color0] (axis cs:-0.523558545830969,0) rectangle (axis cs:-0.387621353147961,1);
30+
\draw[draw=none,fill=color0] (axis cs:-0.387621353147961,0) rectangle (axis cs:-0.251684160464954,0);
31+
\draw[draw=none,fill=color0] (axis cs:-0.251684160464954,0) rectangle (axis cs:-0.115746967781946,0);
32+
\draw[draw=none,fill=color0] (axis cs:-0.115746967781946,0) rectangle (axis cs:0.0201902249010613,0);
33+
\draw[draw=none,fill=color0] (axis cs:0.0201902249010613,0) rectangle (axis cs:0.156127417584069,0);
34+
\draw[draw=none,fill=color0] (axis cs:0.156127417584069,0) rectangle (axis cs:0.292064610267076,1);
35+
\draw[draw=none,fill=color0] (axis cs:0.292064610267076,0) rectangle (axis cs:0.428001802950084,0);
36+
\draw[draw=none,fill=color0] (axis cs:0.428001802950084,0) rectangle (axis cs:0.563938995633091,0);
37+
\draw[draw=none,fill=color0] (axis cs:0.563938995633091,0) rectangle (axis cs:0.699876188316099,0);
38+
\draw[draw=none,fill=color0] (axis cs:0.699876188316099,0) rectangle (axis cs:0.835813380999106,0);
39+
\draw[draw=none,fill=color0] (axis cs:0.835813380999106,0) rectangle (axis cs:0.971750573682114,0);
40+
\draw[draw=none,fill=color0] (axis cs:0.971750573682114,0) rectangle (axis cs:1.10768776636512,1);
41+
\draw[draw=none,fill=color0] (axis cs:1.10768776636512,0) rectangle (axis cs:1.24362495904813,0);
42+
\draw[draw=none,fill=color0] (axis cs:1.24362495904813,0) rectangle (axis cs:1.37956215173114,1);
43+
\draw[draw=none,fill=color0] (axis cs:1.37956215173114,0) rectangle (axis cs:1.51549934441414,0);
44+
\draw[draw=none,fill=color0] (axis cs:1.51549934441414,0) rectangle (axis cs:1.65143653709715,1);
4545
\addplot [semithick, color0]
4646
table {%
4747
1.96 -1

test/test_barchart_errorbars_reference.tex

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
ymin=0, ymax=5.355,
1111
ytick style={color=black}
1212
]
13-
\draw[fill=blue,draw opacity=0] (axis cs:-0.375,0) rectangle (axis cs:-0.125,1);
14-
\draw[fill=blue,draw opacity=0] (axis cs:0.625,0) rectangle (axis cs:0.875,2);
15-
\draw[fill=blue,draw opacity=0] (axis cs:1.625,0) rectangle (axis cs:1.875,3);
16-
\draw[fill=green!50.0!black,draw opacity=0] (axis cs:-0.125,0) rectangle (axis cs:0.125,3);
17-
\draw[fill=green!50.0!black,draw opacity=0] (axis cs:0.875,0) rectangle (axis cs:1.125,2);
18-
\draw[fill=green!50.0!black,draw opacity=0] (axis cs:1.875,0) rectangle (axis cs:2.125,4);
19-
\draw[fill=red,draw opacity=0] (axis cs:0.125,0) rectangle (axis cs:0.375,5);
20-
\draw[fill=red,draw opacity=0] (axis cs:1.125,0) rectangle (axis cs:1.375,3);
21-
\draw[fill=red,draw opacity=0] (axis cs:2.125,0) rectangle (axis cs:2.375,1);
13+
\draw[draw=none,fill=blue] (axis cs:-0.375,0) rectangle (axis cs:-0.125,1);
14+
\draw[draw=none,fill=blue] (axis cs:0.625,0) rectangle (axis cs:0.875,2);
15+
\draw[draw=none,fill=blue] (axis cs:1.625,0) rectangle (axis cs:1.875,3);
16+
\draw[draw=none,fill=green!50.0!black] (axis cs:-0.125,0) rectangle (axis cs:0.125,3);
17+
\draw[draw=none,fill=green!50.0!black] (axis cs:0.875,0) rectangle (axis cs:1.125,2);
18+
\draw[draw=none,fill=green!50.0!black] (axis cs:1.875,0) rectangle (axis cs:2.125,4);
19+
\draw[draw=none,fill=red] (axis cs:0.125,0) rectangle (axis cs:0.375,5);
20+
\draw[draw=none,fill=red] (axis cs:1.125,0) rectangle (axis cs:1.375,3);
21+
\draw[draw=none,fill=red] (axis cs:2.125,0) rectangle (axis cs:2.375,1);
2222
\path [draw=black, line width=2.0pt]
2323
(axis cs:-0.25,0.9)
2424
--(axis cs:-0.25,1.1);

test/test_barchart_legend_reference.tex

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,24 @@
1212
ymin=0, ymax=5.25,
1313
ytick style={color=black}
1414
]
15-
\draw[fill=blue,draw opacity=0] (axis cs:-0.375,0) rectangle (axis cs:-0.125,1);
16-
\addlegendimage{ybar,ybar legend,fill=blue,draw opacity=0};
15+
\draw[draw=none,fill=blue] (axis cs:-0.375,0) rectangle (axis cs:-0.125,1);
16+
\addlegendimage{ybar,ybar legend,draw=none,fill=blue};
1717
\addlegendentry{Data 1}
1818

19-
\draw[fill=blue,draw opacity=0] (axis cs:0.625,0) rectangle (axis cs:0.875,2);
20-
\draw[fill=blue,draw opacity=0] (axis cs:1.625,0) rectangle (axis cs:1.875,3);
21-
\draw[fill=green!50.0!black,draw opacity=0] (axis cs:-0.125,0) rectangle (axis cs:0.125,3);
22-
\addlegendimage{ybar,ybar legend,fill=green!50.0!black,draw opacity=0};
19+
\draw[draw=none,fill=blue] (axis cs:0.625,0) rectangle (axis cs:0.875,2);
20+
\draw[draw=none,fill=blue] (axis cs:1.625,0) rectangle (axis cs:1.875,3);
21+
\draw[draw=none,fill=green!50.0!black] (axis cs:-0.125,0) rectangle (axis cs:0.125,3);
22+
\addlegendimage{ybar,ybar legend,draw=none,fill=green!50.0!black};
2323
\addlegendentry{Data 2}
2424

25-
\draw[fill=green!50.0!black,draw opacity=0] (axis cs:0.875,0) rectangle (axis cs:1.125,2);
26-
\draw[fill=green!50.0!black,draw opacity=0] (axis cs:1.875,0) rectangle (axis cs:2.125,4);
27-
\draw[fill=red,draw opacity=0] (axis cs:0.125,0) rectangle (axis cs:0.375,5);
28-
\addlegendimage{ybar,ybar legend,fill=red,draw opacity=0};
25+
\draw[draw=none,fill=green!50.0!black] (axis cs:0.875,0) rectangle (axis cs:1.125,2);
26+
\draw[draw=none,fill=green!50.0!black] (axis cs:1.875,0) rectangle (axis cs:2.125,4);
27+
\draw[draw=none,fill=red] (axis cs:0.125,0) rectangle (axis cs:0.375,5);
28+
\addlegendimage{ybar,ybar legend,draw=none,fill=red};
2929
\addlegendentry{Data 3}
3030

31-
\draw[fill=red,draw opacity=0] (axis cs:1.125,0) rectangle (axis cs:1.375,3);
32-
\draw[fill=red,draw opacity=0] (axis cs:2.125,0) rectangle (axis cs:2.375,1);
31+
\draw[draw=none,fill=red] (axis cs:1.125,0) rectangle (axis cs:1.375,3);
32+
\draw[draw=none,fill=red] (axis cs:2.125,0) rectangle (axis cs:2.375,1);
3333
\end{axis}
3434

3535
\end{tikzpicture}

test/test_barchart_reference.tex

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
ymin=0, ymax=5.25,
1111
ytick style={color=black}
1212
]
13-
\draw[fill=blue,draw opacity=0] (axis cs:-0.375,0) rectangle (axis cs:-0.125,1);
14-
\draw[fill=blue,draw opacity=0] (axis cs:0.625,0) rectangle (axis cs:0.875,2);
15-
\draw[fill=blue,draw opacity=0] (axis cs:1.625,0) rectangle (axis cs:1.875,3);
16-
\draw[fill=green!50.0!black,draw opacity=0] (axis cs:-0.125,0) rectangle (axis cs:0.125,3);
17-
\draw[fill=green!50.0!black,draw opacity=0] (axis cs:0.875,0) rectangle (axis cs:1.125,2);
18-
\draw[fill=green!50.0!black,draw opacity=0] (axis cs:1.875,0) rectangle (axis cs:2.125,4);
19-
\draw[fill=red,draw opacity=0] (axis cs:0.125,0) rectangle (axis cs:0.375,5);
20-
\draw[fill=red,draw opacity=0] (axis cs:1.125,0) rectangle (axis cs:1.375,3);
21-
\draw[fill=red,draw opacity=0] (axis cs:2.125,0) rectangle (axis cs:2.375,1);
13+
\draw[draw=none,fill=blue] (axis cs:-0.375,0) rectangle (axis cs:-0.125,1);
14+
\draw[draw=none,fill=blue] (axis cs:0.625,0) rectangle (axis cs:0.875,2);
15+
\draw[draw=none,fill=blue] (axis cs:1.625,0) rectangle (axis cs:1.875,3);
16+
\draw[draw=none,fill=green!50.0!black] (axis cs:-0.125,0) rectangle (axis cs:0.125,3);
17+
\draw[draw=none,fill=green!50.0!black] (axis cs:0.875,0) rectangle (axis cs:1.125,2);
18+
\draw[draw=none,fill=green!50.0!black] (axis cs:1.875,0) rectangle (axis cs:2.125,4);
19+
\draw[draw=none,fill=red] (axis cs:0.125,0) rectangle (axis cs:0.375,5);
20+
\draw[draw=none,fill=red] (axis cs:1.125,0) rectangle (axis cs:1.375,3);
21+
\draw[draw=none,fill=red] (axis cs:2.125,0) rectangle (axis cs:2.375,1);
2222
\end{axis}
2323

2424
\end{tikzpicture}

test/test_colorbars_reference.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
--(axis cs:-5,10)
2222
--cycle;
2323
\addplot graphics [includegraphics cmd=\pgfimage,xmin=-5, xmax=10, ymin=-5, ymax=10] {tmp-000.png};
24-
\path [draw=black, fill opacity=0, line width=0.32000000000000006pt]
24+
\path [draw=black, line width=0.32000000000000006pt]
2525
(axis cs:-5,-5)
2626
--(axis cs:-4.94140625,-5)
2727
--(axis cs:9.94140625,-5)
@@ -54,7 +54,7 @@
5454
--(axis cs:-0.05,0.5)
5555
--cycle;
5656
\addplot graphics [includegraphics cmd=\pgfimage,xmin=-0.05, xmax=1.05, ymin=0, ymax=1] {tmp-001.png};
57-
\path [draw=black, fill opacity=0, line width=0.32000000000000006pt]
57+
\path [draw=black, line width=0.32000000000000006pt]
5858
(axis cs:-0.05,0.5)
5959
--(axis cs:0,0)
6060
--(axis cs:1,0)
@@ -87,7 +87,7 @@
8787
--(axis cs:-0.25,0.5)
8888
--cycle;
8989
\addplot graphics [includegraphics cmd=\pgfimage,xmin=-0.25, xmax=1.25, ymin=0, ymax=1] {tmp-002.png};
90-
\path [draw=black, fill opacity=0, line width=0.32000000000000006pt]
90+
\path [draw=black, line width=0.32000000000000006pt]
9191
(axis cs:-0.25,0.5)
9292
--(axis cs:0,0)
9393
--(axis cs:1,0)

test/test_fancybox_reference.tex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
text=black,
3333
rotate=0.0
3434
]{boxstyle='round, pad=0.1'};
35-
\path [draw=black, fill opacity=0]
35+
\path [draw=black]
3636
(axis cs:0.3,0.4)
3737
--(axis cs:0.7,0.4)
3838
--(axis cs:0.7,0.6)
@@ -68,7 +68,7 @@
6868
rotate=0.0,
6969
align=left
7070
]{boxstyle='round,pad=0.1\\rounding\_size=0.2'};
71-
\path [draw=black, fill opacity=0]
71+
\path [draw=black]
7272
(axis cs:0.3,0.4)
7373
--(axis cs:0.7,0.4)
7474
--(axis cs:0.7,0.6)
@@ -104,7 +104,7 @@
104104
rotate=0.0,
105105
align=left
106106
]{boxstyle='round,pad=0.1'\\mutation\_scale=2};
107-
\path [draw=black, fill opacity=0]
107+
\path [draw=black]
108108
(axis cs:0.3,0.4)
109109
--(axis cs:0.7,0.4)
110110
--(axis cs:0.7,0.6)
@@ -140,7 +140,7 @@
140140
rotate=0.0,
141141
align=left
142142
]{boxstyle='round, pad=0.3'\\mutation\_aspect=.5};
143-
\path [draw=green!50.0!black, fill opacity=0]
143+
\path [draw=green!50.0!black]
144144
(axis cs:0.3,0.2)
145145
--(axis cs:0.7,0.2)
146146
.. controls (axis cs:0.833333333333333,0.2) and (axis cs:0.9,0.266666666666667) .. (axis cs:0.9,0.4)
@@ -151,7 +151,7 @@
151151
--(axis cs:0.1,0.4)
152152
.. controls (axis cs:0.1,0.266666666666667) and (axis cs:0.166666666666667,0.2) .. (axis cs:0.3,0.2)
153153
--cycle;
154-
\path [draw=black, fill opacity=0]
154+
\path [draw=black]
155155
(axis cs:0.3,0.4)
156156
--(axis cs:0.7,0.4)
157157
--(axis cs:0.7,0.6)

test/test_hatch.py

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
from helpers import assert_equality
2+
3+
4+
def plot():
5+
"""
6+
Hatch demo code from
7+
https://matplotlib.org/3.1.1/gallery/shapes_and_collections/hatch_demo.html
8+
9+
Slightly modified to test more aspects of the hatch implementation
10+
"""
11+
import matplotlib.pyplot as plt
12+
from matplotlib.patches import Ellipse, Polygon
13+
14+
fig, (ax1, ax2, ax3) = plt.subplots(3)
15+
16+
ax1.bar(range(1, 5), range(1, 5), color="red", edgecolor="black", hatch="/")
17+
ax1.bar(
18+
range(1, 5),
19+
[6] * 4,
20+
bottom=range(1, 5),
21+
color="blue",
22+
edgecolor="black",
23+
hatch="//",
24+
)
25+
ax1.set_xticks([1.5, 2.5, 3.5, 4.5])
26+
27+
bars = ax2.bar(
28+
range(1, 5), range(1, 5), color="yellow", edgecolor="black"
29+
) + ax2.bar(range(1, 5), [6] * 4, bottom=range(1, 5), color="green")
30+
ax2.set_xticks([1.5, 2.5, 3.5, 4.5])
31+
32+
patterns = ("-", "+", "x", "\\", "*", "o", "O", ".")
33+
for bar, pattern in zip(bars, patterns):
34+
bar.set_hatch(pattern)
35+
36+
ax3.fill(
37+
[1, 3, 3, 1], [1, 1, 2, 2], fill=False, hatch="\\", zorder=1, label="Square"
38+
)
39+
ax3.add_patch(
40+
Ellipse((4, 1.5), 4, 0.5, fill="green", hatch="*", zorder=3, label="Ellipse")
41+
)
42+
p = Polygon(
43+
[[0, 0], [4, 1.1], [6, 2.5], [2, 1.4]],
44+
closed=True,
45+
fill=False,
46+
hatch="/",
47+
zorder=2,
48+
label="Polygon",
49+
)
50+
p._hatch_color = (0.5, 0.3, 0.8, 0.7)
51+
ax3.add_patch(p)
52+
ax3.set_xlim((0, 6))
53+
ax3.set_ylim((0, 2.5))
54+
ax3.legend()
55+
56+
return fig
57+
58+
59+
def test():
60+
assert_equality(plot, "test_hatch_reference.tex")
61+
62+
63+
if __name__ == "__main__":
64+
import helpers
65+
66+
helpers.compare_mpl_latex(plot)

0 commit comments

Comments
 (0)