File tree 2 files changed +25
-3
lines changed
2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -395,11 +395,22 @@ def drawPlot(self, ax):
395
395
if self .yLabel is not None :
396
396
ax .set_ylabel (self .yLabel )
397
397
398
+ legendKeywords = {}
399
+
400
+ if self .legendCols > 0 :
401
+ (superMajor , major , minor ) = [int (x ) for x in matplotlib .__version__ .split ('.' )]
402
+
403
+ if superMajor == 0 and major < 98 :
404
+ print >> sys .stderr , "Number of columns support not available in versions of matplotlib prior to 0.98"
405
+ else :
406
+ legendKeywords ["ncol" ] = self .legendCols
407
+
408
+
398
409
if self .legend :
399
410
pylab .legend (plotHandles , plotLabels , loc = self .legendLoc ,
400
- ncol = self . legendCols )
411
+ ** legendKeywords )
401
412
if self .figLegend :
402
413
pylab .figlegend (plotHandles , plotLabels , loc = self .legendLoc ,
403
- ncol = self . legendCols )
414
+ ** legendKeywords )
404
415
405
416
return (plotHandles , plotLabels )
Original file line number Diff line number Diff line change 1
1
import pylab
2
+ import matplotlib
2
3
from matplotlib import pyplot
3
4
import sys
4
5
@@ -218,9 +219,19 @@ def __doPlot(self):
218
219
ungroupedPlotsRemaining -= 1
219
220
220
221
if self .figLegendLoc is not None :
222
+ figLegendKeywords = {}
223
+
224
+ if self .figLegendCols is not None :
225
+ (superMajor , major , minor ) = [int (x ) for x in matplotlib .__version__ .split ('.' )]
226
+
227
+ if superMajor == 0 and major < 98 :
228
+ print >> sys .stderr , "Number of columns support not available in versions of matplotlib prior to 0.98"
229
+ else :
230
+ figLegendKeywords ["ncol" ] = self .figLegendCols
231
+
221
232
pylab .figlegend (plotHandles , plotLabels ,
222
233
self .figLegendLoc ,
223
- ncol = self . figLegendCols )
234
+ ** figLegendKeywords )
224
235
225
236
if self .plotParams is not None :
226
237
pylab .subplots_adjust (left = self .plotParams ["left" ],
You can’t perform that action at this time.
0 commit comments