We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cded03a commit d253b8eCopy full SHA for d253b8e
bashplotlib/scatterplot.py
@@ -34,7 +34,7 @@ def _plot_scatter(xs, ys, size, pch, colour, title, cs):
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)))
+ # 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):
@@ -47,7 +47,8 @@ def _plot_scatter(xs, ys, size, pch, colour, title, cs):
47
colour = cs[i]
48
printcolour(point + " ", True, colour)
49
print(" |")
50
51
+ print(wrap_text_with_symbol("-" * (2 * (len(get_scale(xs, False, size)) + 1)), "+"))
52
53
def plot_scatter(f, xs, ys, size, pch, colour, title):
54
"""
bashplotlib/utils/helpers.py
@@ -80,7 +80,17 @@ def box_text(text, width, offset=0):
80
81
Return text inside an ascii textbox
82
83
- box = " " * offset + "-" * (width+2) + "\n"
+ box = " " * offset + wrap_text_with_symbol("-" * width, "+") + "\n"
84
+ # box = " " * offset + "-" * (width+2) + "\n"
85
box += " " * offset + "|" + text.center(width) + "|" + "\n"
- box += " " * offset + "-" * (width+2)
86
+ # box += " " * offset + "-" * (width+2)
87
+ box += " " * offset + wrap_text_with_symbol("-" * width, "+")
88
return box
89
+
90
+def wrap_text_with_symbol(text, symbol = "+"):
91
+ """
92
+ Returns text wrapped with symbol
93
+ default wrapper is '+'
94
95
+ newText = symbol + text + symbol
96
+ return newText
scratch.py
@@ -0,0 +1,18 @@
1
+# scratch.py
2
+from bashplotlib.scatterplot import plot_scatter
3
4
+x_coords = [-10,20,30]
5
+y_coords = [-10,20,30]
6
+width = 10
7
+char = 'x'
8
+color = 'default'
9
+title = 'My Test Graph'
10
11
+plot_scatter(
12
+ None,
13
+ x_coords,
14
+ y_coords,
15
+ width,
16
+ char,
17
+ color,
18
+ title)
0 commit comments