Skip to content
This repository was archived by the owner on Nov 22, 2019. It is now read-only.

Commit 86ab9a1

Browse files
committed
Display labels in plot_that_lut
For curves only.
1 parent 9773da9 commit 86ab9a1

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

plotThatLut/plot_that_lut.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import matplotlib
1818
import itertools
1919
from utils import matplotlib_helper as mplh
20+
import ntpath
2021

2122

2223
class PlotThatLutException(Exception):
@@ -130,16 +131,30 @@ def plot_curve(lutfiles, samples_count, processors, draw_red_curve=True,
130131
if display_markers:
131132
markersize = 4
132133
# plot curves
134+
labelbase = os.path.splitext(ntpath.basename(lutfile))[0]
133135
if draw_red_curve:
136+
if not draw_blue_curve and not draw_green_curve:
137+
label = labelbase
138+
else:
139+
label = "{0} (R)".format(labelbase)
134140
plot(input_range, red_values, color=reds_it.next(), marker=marker,
135-
label='Red values', linewidth=1, markersize=markersize)
141+
label=label, linewidth=1, markersize=markersize)
136142
if draw_green_curve:
143+
if not draw_blue_curve and not draw_red_curve:
144+
label = labelbase
145+
else:
146+
label = "{0} (G)".format(labelbase)
137147
plot(input_range, green_values, color=greens_it.next(),
138-
marker=marker, label='Green values', linewidth=1,
148+
marker=marker, label=label, linewidth=1,
139149
markersize=markersize)
140150
if draw_blue_curve:
151+
if not draw_green_curve and not draw_red_curve:
152+
label = labelbase
153+
else:
154+
label = "{0} (B)".format(labelbase)
141155
plot(input_range, blue_values, color=blues_it.next(), marker=marker,
142-
label='Blue values', linewidth=1, markersize=markersize)
156+
label=label, linewidth=1, markersize=markersize)
157+
matplotlib.pyplot.legend(loc=4)
143158
return show_plot(fig, filename)
144159

145160

0 commit comments

Comments
 (0)