Commit b4f011c
committed
ENH: remove arbitrary long args if used with data
Arbitrary long args, i.e., plot("x","y","r","x2","y2","b") were problematic if
used with a data kwarg and the color spec ("r", "b") was included in data: this
made it impossible in some cases to determine what the user wanted to plot:
plot("x","y","r","x2","y2","b", data={..., "r":..., "b":...)
could be interpreted as
plot(x, y, "r") # all points red
plot(x2, y2, "b") # all points black
or
plot(x,y)
plot(r,x2)
plot(y2,b)
This could lead to hard to debug problems if both styles result in a similar plot
(e.g. if all are values in the same range). Therefore it was decided to remove
this possibility so that the usere gets a proper error message instead:
#4829 (comment)
There is still a case of ambiguity (plot("y", "ro", data={"y":..., "ro":...),
which is now detected and a warning is issued. This detection could theoretically
be used to detect the above case as well, but there were so many corner cases,
that the checks became too horrible and I took that out again.
Note that passing in data directly (without a data kwarg) is unaffected, it still
accepts arbitrary long args.1 parent 25b1d43 commit b4f011c
2 files changed
Lines changed: 55 additions & 47 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
65 | 76 | | |
66 | | - | |
67 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
68 | 80 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
83 | 88 | | |
84 | 89 | | |
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
| 93 | + | |
88 | 94 | | |
89 | 95 | | |
90 | 96 | | |
| |||
1305 | 1311 | | |
1306 | 1312 | | |
1307 | 1313 | | |
1308 | | - | |
1309 | | - | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
1310 | 1322 | | |
1311 | 1323 | | |
1312 | 1324 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
467 | 467 | | |
468 | 468 | | |
469 | 469 | | |
470 | | - | |
471 | | - | |
472 | 470 | | |
473 | 471 | | |
474 | 472 | | |
475 | 473 | | |
476 | 474 | | |
| 475 | + | |
477 | 476 | | |
478 | 477 | | |
479 | 478 | | |
480 | 479 | | |
481 | 480 | | |
482 | | - | |
483 | | - | |
484 | 481 | | |
485 | | - | |
486 | | - | |
487 | | - | |
| 482 | + | |
| 483 | + | |
488 | 484 | | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
0 commit comments