(args, column, role)
| 212 | |
| 213 | |
| 214 | def get_decorated_label(args, column, role): |
| 215 | original_label = label = get_label(args, column) |
| 216 | if "histfunc" in args and ( |
| 217 | (role == "z") |
| 218 | or (role == "x" and "orientation" in args and args["orientation"] == "h") |
| 219 | or (role == "y" and "orientation" in args and args["orientation"] == "v") |
| 220 | ): |
| 221 | histfunc = args["histfunc"] or "count" |
| 222 | if histfunc != "count": |
| 223 | label = "%s of %s" % (histfunc, label) |
| 224 | else: |
| 225 | label = "count" |
| 226 | |
| 227 | if "histnorm" in args and args["histnorm"] is not None: |
| 228 | if label == "count": |
| 229 | label = args["histnorm"] |
| 230 | else: |
| 231 | histnorm = args["histnorm"] |
| 232 | if histfunc == "sum": |
| 233 | if histnorm == "probability": |
| 234 | label = "%s of %s" % ("fraction", label) |
| 235 | elif histnorm == "percent": |
| 236 | label = "%s of %s" % (histnorm, label) |
| 237 | else: |
| 238 | label = "%s weighted by %s" % (histnorm, original_label) |
| 239 | elif histnorm == "probability": |
| 240 | label = "%s of sum of %s" % ("fraction", label) |
| 241 | elif histnorm == "percent": |
| 242 | label = "%s of sum of %s" % ("percent", label) |
| 243 | else: |
| 244 | label = "%s of %s" % (histnorm, label) |
| 245 | |
| 246 | if "barnorm" in args and args["barnorm"] is not None: |
| 247 | label = "%s (normalized as %s)" % (label, args["barnorm"]) |
| 248 | |
| 249 | return label |
| 250 | |
| 251 | |
| 252 | def make_mapping(args, variable): |
no test coverage detected