Skip to content

Commit f907431

Browse files
committed
fix for colormaps in tests
1 parent b2208c7 commit f907431

10 files changed

+15
-135
lines changed

test/test_image_plot_lower.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def plot():
2323
ax = plt.axes([0, 0, 1, 1], frameon=False)
2424
ax.set_axis_off()
2525
plt.imshow(img, cmap="viridis", origin="lower")
26-
# Set the current color map to HSV.
27-
plt.hsv()
26+
# Setting the current color map to HSV messes up other plots
27+
# plt.hsv()
2828
plt.colorbar()
2929
return fig
3030

test/test_image_plot_lower_reference.tex

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,7 @@
33
\begin{axis}[
44
colorbar,
55
colorbar style={ylabel={}},
6-
colormap={mymap}{[1pt]
7-
rgb(0pt)=(1,0,0);
8-
rgb(10pt)=(1,0.9375,0);
9-
rgb(11pt)=(0.96875,1,0);
10-
rgb(21pt)=(0.03125,1,0);
11-
rgb(22pt)=(0,1,0.0625);
12-
rgb(32pt)=(0,1,1);
13-
rgb(42pt)=(0,0.0625,1);
14-
rgb(43pt)=(0.03125,0,1);
15-
rgb(53pt)=(0.96875,0,1);
16-
rgb(54pt)=(1,0,0.9375);
17-
rgb(63pt)=(1,0,0.09375)
18-
},
6+
colormap/viridis,
197
hide x axis,
208
hide y axis,
219
point meta max=1,

test/test_image_plot_upper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ def plot():
2222

2323
plt.imshow(img, cmap="viridis", origin="upper")
2424

25-
# Set the current color map to HSV.
26-
plt.hsv()
25+
# Setting the current color map to HSV messes up other plots
26+
# plt.hsv()
2727
plt.colorbar()
2828
return fig
2929

3030

3131
# TODO reintroduce
3232
# from helpers import assert_equality
3333
# def test():
34-
# assert_equality(plot, "test_image_plot_lower_reference.tex")
34+
# assert_equality(plot, __file__[:-3] + "_reference.tex")
3535
# return

test/test_image_plot_upper_reference.tex

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,7 @@
33
\begin{axis}[
44
colorbar,
55
colorbar style={ylabel={}},
6-
colormap={mymap}{[1pt]
7-
rgb(0pt)=(1,0,0);
8-
rgb(10pt)=(1,0.9375,0);
9-
rgb(11pt)=(0.96875,1,0);
10-
rgb(21pt)=(0.03125,1,0);
11-
rgb(22pt)=(0,1,0.0625);
12-
rgb(32pt)=(0,1,1);
13-
rgb(42pt)=(0,0.0625,1);
14-
rgb(43pt)=(0.03125,0,1);
15-
rgb(53pt)=(0.96875,0,1);
16-
rgb(54pt)=(1,0,0.9375);
17-
rgb(63pt)=(1,0,0.09375)
18-
},
6+
colormap/viridis,
197
hide x axis,
208
hide y axis,
219
point meta max=1,

test/test_line_collection_reference.tex

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,7 @@
55
\begin{axis}[
66
colorbar,
77
colorbar style={ylabel={Line Number}},
8-
colormap={mymap}{[1pt]
9-
rgb(0pt)=(1,0,0);
10-
rgb(10pt)=(1,0.9375,0);
11-
rgb(11pt)=(0.96875,1,0);
12-
rgb(21pt)=(0.03125,1,0);
13-
rgb(22pt)=(0,1,0.0625);
14-
rgb(32pt)=(0,1,1);
15-
rgb(42pt)=(0,0.0625,1);
16-
rgb(43pt)=(0.03125,0,1);
17-
rgb(53pt)=(0.96875,0,1);
18-
rgb(54pt)=(1,0,0.9375);
19-
rgb(63pt)=(1,0,0.09375)
20-
},
8+
colormap/viridis,
219
point meta max=9,
2210
point meta min=0,
2311
tick align=outside,

test/test_noise2_reference.tex

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,7 @@
33
\begin{axis}[
44
colorbar horizontal,
55
colorbar style={xtick={-1,0,1},xticklabels={Low,Medium,High}},
6-
colormap={mymap}{[1pt]
7-
rgb(0pt)=(1,0,0);
8-
rgb(10pt)=(1,0.9375,0);
9-
rgb(11pt)=(0.96875,1,0);
10-
rgb(21pt)=(0.03125,1,0);
11-
rgb(22pt)=(0,1,0.0625);
12-
rgb(32pt)=(0,1,1);
13-
rgb(42pt)=(0,0.0625,1);
14-
rgb(43pt)=(0.03125,0,1);
15-
rgb(53pt)=(0.96875,0,1);
16-
rgb(54pt)=(1,0,0.9375);
17-
rgb(63pt)=(1,0,0.09375)
18-
},
6+
colormap/viridis,
197
point meta max=1,
208
point meta min=-1,
219
tick align=outside,

test/test_noise_reference.tex

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,7 @@
33
\begin{axis}[
44
colorbar,
55
colorbar style={ytick={-1,0,1},yticklabels={< -1,0,> 1},ylabel={}},
6-
colormap={mymap}{[1pt]
7-
rgb(0pt)=(1,0,0);
8-
rgb(10pt)=(1,0.9375,0);
9-
rgb(11pt)=(0.96875,1,0);
10-
rgb(21pt)=(0.03125,1,0);
11-
rgb(22pt)=(0,1,0.0625);
12-
rgb(32pt)=(0,1,1);
13-
rgb(42pt)=(0,0.0625,1);
14-
rgb(43pt)=(0.03125,0,1);
15-
rgb(53pt)=(0.96875,0,1);
16-
rgb(54pt)=(1,0,0.9375);
17-
rgb(63pt)=(1,0,0.09375)
18-
},
6+
colormap/viridis,
197
point meta max=1,
208
point meta min=-1,
219
tick align=outside,

test/test_scatter_colormap_reference.tex

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,7 @@
88
y grid style={white!69.01960784313725!black},
99
ymin=-0.835853216474104, ymax=2.35933144192702
1010
]
11-
\addplot [only marks, scatter, scatter src=explicit, colormap={mymap}{[1pt]
12-
rgb(0pt)=(1,0,0);
13-
rgb(10pt)=(1,0.9375,0);
14-
rgb(11pt)=(0.96875,1,0);
15-
rgb(21pt)=(0.03125,1,0);
16-
rgb(22pt)=(0,1,0.0625);
17-
rgb(32pt)=(0,1,1);
18-
rgb(42pt)=(0,0.0625,1);
19-
rgb(43pt)=(0.03125,0,1);
20-
rgb(53pt)=(0.96875,0,1);
21-
rgb(54pt)=(1,0,0.9375);
22-
rgb(63pt)=(1,0,0.09375)
23-
}, visualization depends on={\thisrow{sizedata} \as\perpointmarksize}, scatter/@pre marker code/.append style={/tikz/mark size=\perpointmarksize}]
11+
\addplot [only marks, scatter, scatter src=explicit, colormap/viridis, visualization depends on={\thisrow{sizedata} \as\perpointmarksize}, scatter/@pre marker code/.append style={/tikz/mark size=\perpointmarksize}]
2412
table [x=x, y=y, meta=colordata]{%
2513
x y colordata sizedata
2614
-1.08563060330056 -0.678886151622054 -0.255619370530597 4.89256733647935

test/test_scatter_reference.tex

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,7 @@
1414
ymajorgrids,
1515
ymin=0.162919838390652, ymax=112.82609249885
1616
]
17-
\addplot [only marks, draw=color0, fill=color0, colormap={mymap}{[1pt]
18-
rgb(0pt)=(1,0,0);
19-
rgb(10pt)=(1,0.9375,0);
20-
rgb(11pt)=(0.96875,1,0);
21-
rgb(21pt)=(0.03125,1,0);
22-
rgb(22pt)=(0,1,0.0625);
23-
rgb(32pt)=(0,1,1);
24-
rgb(42pt)=(0,0.0625,1);
25-
rgb(43pt)=(0.03125,0,1);
26-
rgb(53pt)=(0.96875,0,1);
27-
rgb(54pt)=(1,0,0.9375);
28-
rgb(63pt)=(1,0,0.09375)
29-
}]
17+
\addplot [only marks, draw=color0, fill=color0, colormap/viridis]
3018
table{%
3119
x y
3220
0 10.4470377839679

test/test_subplots_with_colorbars_reference.tex

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,7 @@
33
\begin{groupplot}[group style={group size=3 by 1}]
44
\nextgroupplot[
55
colorbar horizontal,
6-
colormap={mymap}{[1pt]
7-
rgb(0pt)=(1,0,0);
8-
rgb(10pt)=(1,0.9375,0);
9-
rgb(11pt)=(0.96875,1,0);
10-
rgb(21pt)=(0.03125,1,0);
11-
rgb(22pt)=(0,1,0.0625);
12-
rgb(32pt)=(0,1,1);
13-
rgb(42pt)=(0,0.0625,1);
14-
rgb(43pt)=(0.03125,0,1);
15-
rgb(53pt)=(0.96875,0,1);
16-
rgb(54pt)=(1,0,0.9375);
17-
rgb(63pt)=(1,0,0.09375)
18-
},
6+
colormap/viridis,
197
point meta max=1,
208
point meta min=0,
219
tick align=outside,
@@ -29,19 +17,7 @@
2917

3018
\nextgroupplot[
3119
colorbar horizontal,
32-
colormap={mymap}{[1pt]
33-
rgb(0pt)=(1,0,0);
34-
rgb(10pt)=(1,0.9375,0);
35-
rgb(11pt)=(0.96875,1,0);
36-
rgb(21pt)=(0.03125,1,0);
37-
rgb(22pt)=(0,1,0.0625);
38-
rgb(32pt)=(0,1,1);
39-
rgb(42pt)=(0,0.0625,1);
40-
rgb(43pt)=(0.03125,0,1);
41-
rgb(53pt)=(0.96875,0,1);
42-
rgb(54pt)=(1,0,0.9375);
43-
rgb(63pt)=(1,0,0.09375)
44-
},
20+
colormap/viridis,
4521
point meta max=1,
4622
point meta min=0,
4723
tick align=outside,
@@ -55,19 +31,7 @@
5531

5632
\nextgroupplot[
5733
colorbar horizontal,
58-
colormap={mymap}{[1pt]
59-
rgb(0pt)=(1,0,0);
60-
rgb(10pt)=(1,0.9375,0);
61-
rgb(11pt)=(0.96875,1,0);
62-
rgb(21pt)=(0.03125,1,0);
63-
rgb(22pt)=(0,1,0.0625);
64-
rgb(32pt)=(0,1,1);
65-
rgb(42pt)=(0,0.0625,1);
66-
rgb(43pt)=(0.03125,0,1);
67-
rgb(53pt)=(0.96875,0,1);
68-
rgb(54pt)=(1,0,0.9375);
69-
rgb(63pt)=(1,0,0.09375)
70-
},
34+
colormap/viridis,
7135
point meta max=1,
7236
point meta min=0,
7337
tick align=outside,

0 commit comments

Comments
 (0)