Skip to content

Conversation

robert
Copy link
Owner

@robert robert commented Mar 31, 2019

This is one way to solve Task 3 in https://robertheaton.com/2019/04/14/open-source-for-advanced-beginners-1-bashplotlib/.

Test:

I ran:

from bashplotlib.scatterplot import plot_scatter

x_coords = [-10,-4,10,20,30]
y_coords = [-10,-2,18,20,30]
width = 10
char = 'x'
color = 'default'
title = 'Test Title'

plot_scatter(
    None,
    x_coords,
    y_coords,
    width,
    char,
    color,
    title)

and got:

bpl-zero-axes-example

@@ -35,17 +35,43 @@ def _plot_scatter(xs, ys, size, pch, colour, title, cs):
print(box_text(title, 2 * (len(get_scale(xs, False, size)) + 1)))

print("-" * (2 * (len(get_scale(xs, False, size)) + 2)))

# Iterate through all squares in the graph. For each square,
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's worth trying to understand how this double-loop works. It's not necessarily the best way to solve this problem, and there are many alternative approaches one could take. See if you can come up with some.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant