[hotfix] [docs] Remove obsolete file 'plotPoints.py'
Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/49e66bec Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/49e66bec Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/49e66bec Branch: refs/heads/release-1.1 Commit: 49e66bec911b43de5fc1f6ea68581d4d45c6cca9 Parents: e09a454 Author: Stephan Ewen <se...@apache.org> Authored: Mon Aug 1 10:01:35 2016 +0200 Committer: Ufuk Celebi <u...@apache.org> Committed: Tue Aug 2 20:24:36 2016 +0200 ---------------------------------------------------------------------- docs/quickstart/plotPoints.py | 100 ------------------------------------- 1 file changed, 100 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/49e66bec/docs/quickstart/plotPoints.py ---------------------------------------------------------------------- diff --git a/docs/quickstart/plotPoints.py b/docs/quickstart/plotPoints.py deleted file mode 100755 index 9ddf5dd..0000000 --- a/docs/quickstart/plotPoints.py +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/python - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -import sys -import matplotlib.pyplot as plt -import csv -import os - -if len(sys.argv) < 4 or not sys.argv[1] in ['points', 'result']: - print "Usage: plot-clusters.py (points|result) <src-file> <pdf-file-prefix>" - sys.exit(1) - -inFile = sys.argv[1] -inFile = sys.argv[2] -outFilePx = sys.argv[3] - -inFileName = os.path.splitext(os.path.basename(inFile))[0] -outFile = os.path.join(".", outFilePx+"-plot.pdf") - -########### READ DATA - -cs = [] -xs = [] -ys = [] - -minX = None -maxX = None -minY = None -maxY = None - -if sys.argv[1] == 'points': - - with open(inFile, 'rb') as file: - for line in file: - # parse data - csvData = line.strip().split(' ') - - x = float(csvData[0]) - y = float(csvData[1]) - - if not minX or minX > x: - minX = x - if not maxX or maxX < x: - maxX = x - if not minY or minY > y: - minY = y - if not maxY or maxY < y: - maxY = y - - xs.append(x) - ys.append(y) - - # plot data - plt.clf() - plt.scatter(xs, ys, s=25, c="#999999", edgecolors='None', alpha=1.0) - plt.ylim([minY,maxY]) - plt.xlim([minX,maxX]) - -elif sys.argv[1] == 'result': - - with open(inFile, 'rb') as file: - for line in file: - # parse data - csvData = line.strip().split(' ') - - c = int(csvData[0]) - x = float(csvData[1]) - y = float(csvData[2]) - - cs.append(c) - xs.append(x) - ys.append(y) - - # plot data - plt.clf() - plt.scatter(xs, ys, s=25, c=cs, edgecolors='None', alpha=1.0) - plt.ylim([minY,maxY]) - plt.xlim([minX,maxX]) - - -plt.savefig(outFile, dpi=600) -print "\nPlotted file: %s" % outFile - -sys.exit(0) \ No newline at end of file