|
17 | 17 | import matplotlib |
18 | 18 | import itertools |
19 | 19 | from utils import matplotlib_helper as mplh |
| 20 | +import ntpath |
20 | 21 |
|
21 | 22 |
|
22 | 23 | class PlotThatLutException(Exception): |
@@ -130,16 +131,30 @@ def plot_curve(lutfiles, samples_count, processors, draw_red_curve=True, |
130 | 131 | if display_markers: |
131 | 132 | markersize = 4 |
132 | 133 | # plot curves |
| 134 | + labelbase = os.path.splitext(ntpath.basename(lutfile))[0] |
133 | 135 | 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) |
134 | 140 | 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) |
136 | 142 | 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) |
137 | 147 | plot(input_range, green_values, color=greens_it.next(), |
138 | | - marker=marker, label='Green values', linewidth=1, |
| 148 | + marker=marker, label=label, linewidth=1, |
139 | 149 | markersize=markersize) |
140 | 150 | 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) |
141 | 155 | 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) |
143 | 158 | return show_plot(fig, filename) |
144 | 159 |
|
145 | 160 |
|
|
0 commit comments