Skip to content

Commit 7e2e54e

Browse files
authored
Merge pull request #348 from nschloe/legend-opacity
Legend opacity
2 parents e44a75c + 16f166b commit 7e2e54e

16 files changed

+47
-39
lines changed

test/test_barchart_legend_reference.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
\begin{axis}[
44
legend cell align={left},
5-
legend style={draw=white!80.0!black},
5+
legend style={fill opacity=0.8, draw opacity=1, text opacity=1, draw=white!80.0!black},
66
tick align=outside,
77
tick pos=left,
88
x grid style={white!69.01960784313725!black},

test/test_basic_sin_reference.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
axis background/.style={fill=white!89.80392156862746!black},
88
axis line style={white},
99
legend cell align={left},
10-
legend style={at={(0.03,0.03)}, anchor=south west, draw=white!80.0!black, fill=white!89.80392156862746!black},
10+
legend style={fill opacity=0.8, draw opacity=1, text opacity=1, at={(0.03,0.03)}, anchor=south west, draw=white!80.0!black, fill=white!89.80392156862746!black},
1111
tick align=outside,
1212
tick pos=left,
1313
title={Simple plot \(\displaystyle \frac{\alpha}{2}\)},

test/test_histogram_reference.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
\begin{axis}[
77
legend cell align={left},
8-
legend style={draw=white!80.0!black},
8+
legend style={fill opacity=0.8, draw opacity=1, text opacity=1, draw=white!80.0!black},
99
tick align=outside,
1010
tick pos=left,
1111
x grid style={white!69.01960784313725!black},

test/test_legend3_reference.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
\begin{axis}[
44
legend cell align={left},
5-
legend style={at={(0.03,0.97)}, anchor=north west, draw=white!80.0!black},
5+
legend style={fill opacity=0.8, draw opacity=1, text opacity=1, at={(0.03,0.97)}, anchor=north west, draw=white!80.0!black},
66
tick align=outside,
77
tick pos=left,
88
x grid style={white!69.01960784313725!black},

test/test_legend_best_location.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,39 +10,39 @@ def plot():
1010
t = np.arange(0.0, 2.0 * np.pi, 0.4)
1111

1212
# Legend best location is "upper right"
13-
l, = axes[0].plot(t, np.cos(t) * np.exp(-t), linewidth=0.5)
13+
(l,) = axes[0].plot(t, np.cos(t) * np.exp(-t), linewidth=0.5)
1414
axes[0].legend((l,), ("UR",), loc=0)
1515

1616
# Legend best location is "upper left"
17-
l, = axes[1].plot(t, np.cos(t) * np.exp(0.15 * t), linewidth=0.5)
17+
(l,) = axes[1].plot(t, np.cos(t) * np.exp(0.15 * t), linewidth=0.5)
1818
axes[1].legend((l,), ("UL",), loc=0)
1919

2020
# Legend best location is "lower left"
21-
l, = axes[2].plot(t, np.cos(5.0 * t) + 1, linewidth=0.5)
21+
(l,) = axes[2].plot(t, np.cos(5.0 * t) + 1, linewidth=0.5)
2222
axes[2].legend((l,), ("LL",), loc=0)
2323

2424
# Legend best location is "lower right"
25-
l, = axes[3].plot(
25+
(l,) = axes[3].plot(
2626
t, 2 * np.cos(5.0 * t) * np.exp(-0.5 * t) + 0.2 * t, linewidth=0.5
2727
)
2828
axes[3].legend((l,), ("LR",), loc=0)
2929

3030
# Legend best location is "center left"
31-
l, = axes[4].plot(t[30:], 2 * np.cos(10 * t[30:]), linewidth=0.5)
31+
(l,) = axes[4].plot(t[30:], 2 * np.cos(10 * t[30:]), linewidth=0.5)
3232
axes[4].plot(t, -1.5 * np.ones_like(t), t, 1.5 * np.ones_like(t))
3333
axes[4].legend((l,), ("CL",), loc=0)
3434

3535
# Legend best location is "center right"
36-
l, = axes[5].plot(t[:30], 2 * np.cos(10 * t[:30]), linewidth=0.5)
36+
(l,) = axes[5].plot(t[:30], 2 * np.cos(10 * t[:30]), linewidth=0.5)
3737
axes[5].plot(t, -1.5 * np.ones_like(t), t, 1.5 * np.ones_like(t))
3838
axes[5].legend((l,), ("CR",), loc=0)
3939

4040
# Legend best location is "lower center"
41-
l, = axes[6].plot(t, -3 * np.cos(t) * np.exp(-0.1 * t), linewidth=0.5)
41+
(l,) = axes[6].plot(t, -3 * np.cos(t) * np.exp(-0.1 * t), linewidth=0.5)
4242
axes[6].legend((l,), ("LC",), loc=0)
4343

4444
# Legend best location is "upper center"
45-
l, = axes[7].plot(t, 3 * np.cos(t) * np.exp(-0.1 * t), linewidth=0.5)
45+
(l,) = axes[7].plot(t, 3 * np.cos(t) * np.exp(-0.1 * t), linewidth=0.5)
4646
axes[7].legend((l,), ("UC",), loc=0)
4747

4848
# Legend best location is "center"

test/test_legend_best_location_reference.tex

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
\begin{groupplot}[group style={group size=3 by 3}]
99
\nextgroupplot[
1010
legend cell align={left},
11-
legend style={draw=white!80.0!black},
11+
legend style={fill opacity=0.8, draw opacity=1, text opacity=1, draw=white!80.0!black},
1212
tick align=outside,
1313
tick pos=left,
1414
x grid style={white!69.01960784313725!black},
@@ -41,7 +41,7 @@
4141

4242
\nextgroupplot[
4343
legend cell align={left},
44-
legend style={at={(0.03,0.97)}, anchor=north west, draw=white!80.0!black},
44+
legend style={fill opacity=0.8, draw opacity=1, text opacity=1, at={(0.03,0.97)}, anchor=north west, draw=white!80.0!black},
4545
tick align=outside,
4646
tick pos=left,
4747
x grid style={white!69.01960784313725!black},
@@ -74,7 +74,7 @@
7474

7575
\nextgroupplot[
7676
legend cell align={left},
77-
legend style={at={(0.03,0.03)}, anchor=south west, draw=white!80.0!black},
77+
legend style={fill opacity=0.8, draw opacity=1, text opacity=1, at={(0.03,0.03)}, anchor=south west, draw=white!80.0!black},
7878
tick align=outside,
7979
tick pos=left,
8080
x grid style={white!69.01960784313725!black},
@@ -107,7 +107,7 @@
107107

108108
\nextgroupplot[
109109
legend cell align={left},
110-
legend style={at={(0.03,0.03)}, anchor=south west, draw=white!80.0!black},
110+
legend style={fill opacity=0.8, draw opacity=1, text opacity=1, at={(0.03,0.03)}, anchor=south west, draw=white!80.0!black},
111111
tick align=outside,
112112
tick pos=left,
113113
x grid style={white!69.01960784313725!black},
@@ -140,7 +140,7 @@
140140

141141
\nextgroupplot[
142142
legend cell align={left},
143-
legend style={at={(0.91,0.5)}, anchor=east, draw=white!80.0!black},
143+
legend style={fill opacity=0.8, draw opacity=1, text opacity=1, at={(0.91,0.5)}, anchor=east, draw=white!80.0!black},
144144
tick align=outside,
145145
tick pos=left,
146146
x grid style={white!69.01960784313725!black},
@@ -191,7 +191,7 @@
191191

192192
\nextgroupplot[
193193
legend cell align={left},
194-
legend style={at={(0.09,0.5)}, anchor=west, draw=white!80.0!black},
194+
legend style={fill opacity=0.8, draw opacity=1, text opacity=1, at={(0.09,0.5)}, anchor=west, draw=white!80.0!black},
195195
tick align=outside,
196196
tick pos=left,
197197
x grid style={white!69.01960784313725!black},
@@ -262,7 +262,7 @@
262262

263263
\nextgroupplot[
264264
legend cell align={left},
265-
legend style={at={(0.5,0.09)}, anchor=south, draw=white!80.0!black},
265+
legend style={fill opacity=0.8, draw opacity=1, text opacity=1, at={(0.5,0.09)}, anchor=south, draw=white!80.0!black},
266266
tick align=outside,
267267
tick pos=left,
268268
x grid style={white!69.01960784313725!black},
@@ -295,7 +295,7 @@
295295

296296
\nextgroupplot[
297297
legend cell align={left},
298-
legend style={at={(0.5,0.91)}, anchor=north, draw=white!80.0!black},
298+
legend style={fill opacity=0.8, draw opacity=1, text opacity=1, at={(0.5,0.91)}, anchor=north, draw=white!80.0!black},
299299
tick align=outside,
300300
tick pos=left,
301301
x grid style={white!69.01960784313725!black},
@@ -327,7 +327,7 @@
327327
\addlegendentry{UC}
328328

329329
\nextgroupplot[
330-
legend style={draw=white!80.0!black},
330+
legend style={fill opacity=0.8, draw opacity=1, text opacity=1, draw=white!80.0!black},
331331
tick align=outside,
332332
tick pos=left,
333333
x grid style={white!69.01960784313725!black},

test/test_legend_columns_reference.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
\begin{axis}[
77
legend cell align={left},
88
legend columns=2,
9-
legend style={at={(0.5,0.91)}, anchor=north, draw=white!80.0!black},
9+
legend style={fill opacity=0.8, draw opacity=1, text opacity=1, at={(0.5,0.91)}, anchor=north, draw=white!80.0!black},
1010
tick align=outside,
1111
tick pos=left,
1212
x grid style={white!69.01960784313725!black},

test/test_legend_labels_reference.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
\begin{axis}[
88
legend cell align={left},
9-
legend style={draw=white!80.0!black},
9+
legend style={fill opacity=0.8, draw opacity=1, text opacity=1, draw=white!80.0!black},
1010
tick align=outside,
1111
tick pos=left,
1212
x grid style={white!69.01960784313725!black},

test/test_legend_line_scatter_reference.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
\begin{axis}[
66
legend cell align={left},
7-
legend style={at={(0.03,0.97)}, anchor=north west, draw=white!80.0!black},
7+
legend style={fill opacity=0.8, draw opacity=1, text opacity=1, at={(0.03,0.97)}, anchor=north west, draw=white!80.0!black},
88
tick align=outside,
99
tick pos=left,
1010
x grid style={white!69.01960784313725!black},

test/test_legends2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def plot():
1414
# note that plot returns a list of lines. The 'l1, = plot' usage
1515
# extracts the first element of the list inot l1 using tuple unpacking.
1616
# So l1 is a Line2D instance, not a sequence of lines
17-
l1, = axes[k].plot(t2, np.exp(-t2), linewidth=0.5)
17+
(l1,) = axes[k].plot(t2, np.exp(-t2), linewidth=0.5)
1818
axes[k].plot(t2, np.sin(2 * np.pi * t2), "--go", t1, np.log(1 + t1), ".")
1919
axes[k].plot(t2, np.exp(-t2) * np.sin(2 * np.pi * t2), "rs-.")
2020

0 commit comments

Comments
 (0)