MCPcopy
hub / github.com/glamp/bashplotlib / _plot_scatter

Function _plot_scatter

bashplotlib/scatterplot.py:31–50  ·  view source on GitHub ↗
(xs, ys, size, pch, colour, title, cs)

Source from the content-addressed store, hash-verified

29
30
31def _plot_scatter(xs, ys, size, pch, colour, title, cs):
32 plotted = set()
33
34 if title:
35 print(box_text(title, 2 * len(get_scale(xs, False, size)) + 1))
36
37 print("-" * (2 * len(get_scale(xs, False, size)) + 2))
38 for y in get_scale(ys, True, size):
39 print("|", end=' ')
40 for x in get_scale(xs, False, size):
41 point = " "
42 for (i, (xp, yp)) in enumerate(zip(xs, ys)):
43 if xp <= x and yp >= y and (xp, yp) not in plotted:
44 point = pch
45 plotted.add((xp, yp))
46 if cs:
47 colour = cs[i]
48 printcolour(point, True, colour)
49 print(" |")
50 print("-" * (2 * len(get_scale(xs, False, size)) + 2))
51
52def plot_scatter(f, xs, ys, size, pch, colour, title):
53 """

Callers 1

plot_scatterFunction · 0.85

Calls 3

box_textFunction · 0.85
get_scaleFunction · 0.85
printcolourFunction · 0.85

Tested by

no test coverage detected