Example #1
0
    def constructImage(self):
        scatter = Scatter()
        scatter.label="Hooray dots with vlines!"


        scatter.xValues = [
            7, 6, 3, 5, 7, 6, 1, 1, 6, 5, 8, 6, 7, 8, 0, 2, 9, 3, 9,
            5, 4, 5, 0, 0, 2, 3, 1, 4, 1, 3, 3, 8, 1, 5, 2, 6, 0, 3,
            5, 1, 4, 9, 5, 1, 9, 9, 9, 7, 6, 5, 8, 6, 0, 2, 6, 9, 2,
            5, 6, 9, 7, 8, 7, 6, 5, 9, 9, 2, 4, 9, 0, 1, 1, 1, 6, 4,
            5, 8, 9, 1, 2, 1, 4, 5, 9, 7, 4, 9, 2, 9, 2, 5, 2, 2, 0,
            2, 1, 9, 3, 6]
        scatter.yValues = [
            2, 5, 9, 5, 9, 3, 6, 1, 6, 0, 0, 6, 2, 5, 3, 9, 2, 7, 6,
            2, 3, 1, 9, 9, 5, 2, 9, 0, 2, 3, 0, 2, 5, 5, 8, 4, 1, 9,
            8, 6, 1, 6, 9, 2, 4, 9, 2, 8, 1, 1, 2, 1, 0, 6, 3, 4, 2,
            5, 6, 8, 6, 9, 0, 6, 8, 6, 8, 1, 6, 2, 2, 3, 6, 2, 2, 2,
            0, 2, 4, 6, 8, 5, 1, 4, 2, 3, 5, 3, 1, 0, 6, 0, 1, 6, 8,
            9, 3, 9, 3, 7]

        vline1 = VLine()
        vline1.xValues = [2,8]
        vline1.color = 'CornflowerBlue'

        vline2 = VLine()
        vline2.xValues = [1,9]
        vline2.color = 'GoldenRod'

        plot = Plot()
        plot.hasLegend()
        plot.add(scatter)
        plot.add(vline1)
        plot.add(vline2)
        plot.save(self.imageName)
Example #2
0
    def constructImage(self):
        scatter = Scatter()
        scatter.label = "Hooray dots with vlines!"

        scatter.xValues = [
            7, 6, 3, 5, 7, 6, 1, 1, 6, 5, 8, 6, 7, 8, 0, 2, 9, 3, 9, 5, 4, 5,
            0, 0, 2, 3, 1, 4, 1, 3, 3, 8, 1, 5, 2, 6, 0, 3, 5, 1, 4, 9, 5, 1,
            9, 9, 9, 7, 6, 5, 8, 6, 0, 2, 6, 9, 2, 5, 6, 9, 7, 8, 7, 6, 5, 9,
            9, 2, 4, 9, 0, 1, 1, 1, 6, 4, 5, 8, 9, 1, 2, 1, 4, 5, 9, 7, 4, 9,
            2, 9, 2, 5, 2, 2, 0, 2, 1, 9, 3, 6
        ]
        scatter.yValues = [
            2, 5, 9, 5, 9, 3, 6, 1, 6, 0, 0, 6, 2, 5, 3, 9, 2, 7, 6, 2, 3, 1,
            9, 9, 5, 2, 9, 0, 2, 3, 0, 2, 5, 5, 8, 4, 1, 9, 8, 6, 1, 6, 9, 2,
            4, 9, 2, 8, 1, 1, 2, 1, 0, 6, 3, 4, 2, 5, 6, 8, 6, 9, 0, 6, 8, 6,
            8, 1, 6, 2, 2, 3, 6, 2, 2, 2, 0, 2, 4, 6, 8, 5, 1, 4, 2, 3, 5, 3,
            1, 0, 6, 0, 1, 6, 8, 9, 3, 9, 3, 7
        ]

        vline1 = VLine()
        vline1.xValues = [2, 8]
        vline1.color = 'CornflowerBlue'

        vline2 = VLine()
        vline2.xValues = [1, 9]
        vline2.color = 'GoldenRod'

        plot = Plot()
        plot.hasLegend()
        plot.add(scatter)
        plot.add(vline1)
        plot.add(vline2)
        plot.save(self.imageName)
Example #3
0
    def __init__(self, label, color):
        line = Line()
        line.marker = "."
        line.label = label
        line.color = color
        self.line = line

        scatter = Scatter()
        scatter.marker = "x"
        scatter.color = color
        scatter.markerSize = 200
        self.scatter = scatter
Example #4
0
    def constructImage(self):
        line = Line()
        line.xValues = range(5)
        line.yValues = [2, 4, 6, 8, 10]

        linePlot = Plot()
        linePlot.add(line)
        linePlot.setXLabel("X Data")
        linePlot.setYLabel("Y Data")
        linePlot.setTitle("Data as Line")

        bar = Bar()
        bar.xValues = range(5)
        bar.yValues = [2, 4, 6, 8, 10]

        barPlot = Plot()

        barPlot.add(bar)
        barPlot.setXLabel("X Data")
        barPlot.setYLabel("Y Data")
        barPlot.setTitle("Data as Bars")

        scatter = Scatter()
        scatter.xValues = range(5)
        scatter.yValues = [2, 4, 6, 8, 10]

        scatterPlot = Plot()
        scatterPlot.add(scatter)
        scatterPlot.setXLabel("X Data")
        scatterPlot.setYLabel("Y Data")
        scatterPlot.setTitle("Data as Points")


        layout = PlotLayout()
        # Plots in the same grouping are placed together on the same line
        layout.addPlot(linePlot, grouping="topRow")
        layout.addPlot(barPlot, grouping="topRow")

        # Plots without a grouping are arranged as follows:

        # * While you can make a row of N plots, where N is the size of the plot
        # grouping with the largest size, do so.

        # * If you can't make a row of N plots, make the plots stretch across a
        # single row.

        layout.addPlot(scatterPlot)

        # Set values similar to those given in the "Configure subplots" sliders
        # in the interactive figure
        layout.setPlotParameters(hspace=0.48)
        layout.save(self.imageName)
    def constructImage(self):
        line = Line()
        line.xValues = range(5)
        line.yValues = [2, 4, 6, 8, 10]

        linePlot = Plot()
        linePlot.add(line)
        linePlot.xLabel = "X Data"
        linePlot.yLabel = "Y Data"
        linePlot.title = "Data as Line"

        bar = Bar()
        bar.xValues = range(5)
        bar.yValues = [2, 4, 6, 8, 10]

        barPlot = Plot()

        barPlot.add(bar)
        barPlot.xLabel = "X Data"
        barPlot.yLabel = "Y Data"
        barPlot.title = "Data as Bars"

        scatter = Scatter()
        scatter.xValues = range(5)
        scatter.yValues = [2, 4, 6, 8, 10]

        scatterPlot = Plot()
        scatterPlot.add(scatter)
        scatterPlot.xLabel = "X Data"
        scatterPlot.yLabel = "Y Data"
        scatterPlot.title = "Data as Points"

        layout = WeightedPlotLayout()
        # Plots in the same grouping are placed together on the same line
        layout.addPlot(linePlot, grouping="topRow", weight=2)
        layout.addPlot(barPlot, grouping="topRow")

        # Plots without a grouping are arranged as follows:

        # * While you can make a row of N plots, where N is the size of the plot
        # grouping with the largest size, do so.

        # * If you can't make a row of N plots, make the plots stretch across a
        # single row.

        layout.addPlot(scatterPlot)

        layout.save(self.imageName)
Example #6
0
    def constructImage(self):
        line = Line()
        line.xValues = range(5)
        line.yValues = [2, 4, 6, 8, 10]

        linePlot = Plot()
        linePlot.add(line)
        linePlot.xLabel = "X Data"
        linePlot.yLabel = "Y Data"
        linePlot.title = "Data as Line"

        bar = Bar()
        bar.xValues = range(5)
        bar.yValues = [2, 4, 6, 8, 10]

        barPlot = Plot()

        barPlot.add(bar)
        barPlot.xLabel = "X Data"
        barPlot.yLabel = "Y Data"
        barPlot.title = "Data as Bars"

        scatter = Scatter()
        scatter.xValues = range(5)
        scatter.yValues = [2, 4, 6, 8, 10]

        scatterPlot = Plot()
        scatterPlot.add(scatter)
        scatterPlot.xLabel = "X Data"
        scatterPlot.yLabel = "Y Data"
        scatterPlot.title = "Data as Points"

        layout = PlotLayout()

        layout.addPlot(linePlot, grouping="topRow")
        layout.addPlot(barPlot, grouping="topRow")

        layout.addPlot(scatterPlot)

        layout.save(self.imageName)
Example #7
0
    def constructImage(self):
        line = Line()
        line.xValues = range(5)
        line.yValues = [2, 4, 6, 8, 10]

        linePlot = Plot()
        linePlot.add(line)
        linePlot.xLabel = "X Data"
        linePlot.yLabel = "Y Data"
        linePlot.title = "Data as Line"

        bar = Bar()
        bar.xValues = range(5)
        bar.yValues = [2, 4, 6, 8, 10]

        barPlot = Plot()

        barPlot.add(bar)
        barPlot.xLabel = "X Data"
        barPlot.yLabel = "Y Data"
        barPlot.title = "Data as Bars"

        scatter = Scatter()
        scatter.xValues = range(5)
        scatter.yValues = [2, 4, 6, 8, 10]

        scatterPlot = Plot()
        scatterPlot.add(scatter)
        scatterPlot.xLabel = "X Data"
        scatterPlot.yLabel = "Y Data"
        scatterPlot.title = "Data as Points"

        layout = PlotLayout()

        layout.addPlot(linePlot, grouping="topRow")
        layout.addPlot(barPlot, grouping="topRow")

        layout.addPlot(scatterPlot)

        layout.save(self.imageName)
Example #8
0
    def constructImage(self):
        scatter = Scatter()
        scatter.label="Hooray dots!"


        scatter.xValues = [
            7, 6, 3, 5, 7, 6, 1, 1, 6, 5, 8, 6, 7, 8, 0, 2, 9, 3, 9,
            5, 4, 5, 0, 0, 2, 3, 1, 4, 1, 3, 3, 8, 1, 5, 2, 6, 0, 3,
            5, 1, 4, 9, 5, 1, 9, 9, 9, 7, 6, 5, 8, 6, 0, 2, 6, 9, 2,
            5, 6, 9, 7, 8, 7, 6, 5, 9, 9, 2, 4, 9, 0, 1, 1, 1, 6, 4,
            5, 8, 9, 1, 2, 1, 4, 5, 9, 7, 4, 9, 2, 9, 2, 5, 2, 2, 0,
            2, 1, 9, 3, 6]
        scatter.yValues = [
            2, 5, 9, 5, 9, 3, 6, 1, 6, 0, 0, 6, 2, 5, 3, 9, 2, 7, 6,
            2, 3, 1, 9, 9, 5, 2, 9, 0, 2, 3, 0, 2, 5, 5, 8, 4, 1, 9,
            8, 6, 1, 6, 9, 2, 4, 9, 2, 8, 1, 1, 2, 1, 0, 6, 3, 4, 2,
            5, 6, 8, 6, 9, 0, 6, 8, 6, 8, 1, 6, 2, 2, 3, 6, 2, 2, 2,
            0, 2, 4, 6, 8, 5, 1, 4, 2, 3, 5, 3, 1, 0, 6, 0, 1, 6, 8,
            9, 3, 9, 3, 7]

        plot = Plot()
        plot.hasLegend()
        plot.add(scatter)
        plot.save(self.imageName)
Example #9
0
#!/usr/bin/env python
import random
from boomslang import Scatter, Plot

scatter = Scatter()
scatter.label="Hooray dots!"

for i in range(100):
    scatter.xValues.append(random.uniform(0, 10))
    scatter.yValues.append(random.uniform(0, 10))

plot = Plot()
plot.hasLegend()
plot.add(scatter)
plot.save("scatter.png")
Example #10
0
linePlot.setXLabel("X Data")
linePlot.setYLabel("Y Data")
linePlot.setTitle("Data as Line")

bar = Bar()
bar.xValues = range(5)
bar.yValues = [2, 4, 6, 8, 10]

barPlot = Plot()

barPlot.add(bar)
barPlot.setXLabel("X Data")
barPlot.setYLabel("Y Data")
barPlot.setTitle("Data as Bars")

scatter = Scatter()
scatter.xValues = range(5)
scatter.yValues = [2, 4, 6, 8, 10]

scatterPlot = Plot()
scatterPlot.add(scatter)
scatterPlot.setXLabel("X Data")
scatterPlot.setYLabel("Y Data")
scatterPlot.setTitle("Data as Points")


layout = PlotLayout()
# Plots in the same grouping are placed together on the same line
layout.addPlot(linePlot, grouping="topRow")
layout.addPlot(barPlot, grouping="topRow")
Example #11
0
zero_crossings = np.where(np.diff(np.sign(surfFilteredGradient)))[0]
print zero_crossings
roadFeatures = np.zeros((len(zero_crossings), 2))
j = 0
for i in zero_crossings:
    xval = x[i]
    yval = surf[i]
    roadFeatures[j, 0] = xval
    roadFeatures[j, 1] = yval
    j = j + 1




### Plotting
scatter = Scatter()
scatter.xValues = x
scatter.yValues = surf
scatter.markerSize = 1

scatterPlot = Plot()
scatterPlot.add(scatter)
scatterPlot.xLabel = "X Data"
scatterPlot.yLabel = "Height"
scatterPlot.title = "Surface (raw)"

layout = PlotLayout()
layout.addPlot(scatterPlot)
#layout.plot()
layout.save("profile1.png")