GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — allow colour input file · trungnt13/bashplotlib@f25053a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • bashplotlib
    • scatterplot.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎bashplotlib/scatterplot.py‎

Copy file name to clipboardExpand all lines: bashplotlib/scatterplot.py
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import csv
1010
import sys
1111
import optparse
12+
from os.path import isfile
1213
from .utils.helpers import *
1314
from .utils.commandhelp import scatter
1415

@@ -56,6 +57,10 @@ def plot_scatter(f, xs, ys, size, pch, colour, title):
5657
else:
5758
xs = [float(str(row).strip()) for row in open(xs)]
5859
ys = [float(str(row).strip()) for row in open(ys)]
60+
if isfile(colour):
61+
cs = [str(row).strip() for row in open(colour)]
62+
else:
63+
cs = colour
5964

6065
plotted = set()
6166

@@ -71,7 +76,7 @@ def plot_scatter(f, xs, ys, size, pch, colour, title):
7176
if xp <= x and yp >= y and (xp, yp) not in plotted:
7277
point = pch
7378
plotted.add((xp, yp))
74-
if cs:
79+
if isinstance(cs, list):
7580
colour = cs[i]
7681
printcolour(point, True, colour)
7782
print(" |")

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.