Skip to content

Commit ff0a112

Browse files
committed
add exception for row/col =< 0
1 parent 7e2d3e0 commit ff0a112

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

plotly/graph_objs/graph_objs.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,12 @@ def append_trace(self, trace, row, col):
936936
raise Exception("In order to use Figure.append_trace, "
937937
"you must first use tools.make_subplots "
938938
"to create a subplot grid.")
939+
if row <= 0:
940+
raise Exception("Row value is out of range. "
941+
"Note: the starting cell is (1, 1)")
942+
if col <= 0:
943+
raise Exception("Col value is out of range. "
944+
"Note: the starting cell is (1, 1)")
939945
try:
940946
ref = grid_ref[row-1][col-1]
941947
except IndexError:

0 commit comments

Comments
 (0)