()
| 30 | |
| 31 | |
| 32 | def draw_axis(): |
| 33 | graph.draw_line((-SIZE_X, 0), (SIZE_X, 0)) # axis lines |
| 34 | graph.draw_line((0, -SIZE_Y), (0, SIZE_Y)) |
| 35 | |
| 36 | for x in range(-SIZE_X, SIZE_X+1, NUMBER_MARKER_FREQUENCY): |
| 37 | graph.draw_line((x, -SIZE_Y/66), (x, SIZE_Y/66)) # tick marks |
| 38 | if x != 0: |
| 39 | # numeric labels |
| 40 | graph.draw_text(str(x), (x, -SIZE_Y/15), color='green', font='courier 10') |
| 41 | |
| 42 | for y in range(-SIZE_Y, SIZE_Y+1, NUMBER_MARKER_FREQUENCY): |
| 43 | graph.draw_line((-SIZE_X/66, y), (SIZE_X/66, y)) |
| 44 | if y != 0: |
| 45 | graph.draw_text(str(y), (-SIZE_X/11, y), color='blue', font='courier 10') |
| 46 | |
| 47 | # Create the graph that will be put into the window. Making outside of layout so have element in a variable |
| 48 | graph = sg.Graph(canvas_size=(500, 500), |
no test coverage detected