示例#1
0
    def constructImage(self):
        line1 = Line()
        line1.xValues = range(7)
        line1.yValues = [1, 2, 4, 8, 16, 32, 64]
        line1.label = "First Plot"
        line1.lineStyle = "-"
        line1.color = "red"

        line2 = Line()
        line2.xValues = range(7)
        line2.yValues = [100, 90, 80, 70, 60, 50, 40]
        line2.label = "Second Plot"
        line2.lineStyle = "--"
        line2.color = "blue"

        plot = Plot()
        plot.add(line1)
        plot.add(line2)
        plot.xLabel = "Shared X Axis"
        plot.yLabel = "First Plot's Y Axis"
        plot.setTwinX("Second Plot's Y Axis", 1)
        plot.hasLegend()

        plot.save(self.imageName)
示例#2
0
文件: twinx.py 项目: crazyideas21/dev
#!/usr/bin/env python

from boomslang import Line, Plot

line1 = Line()
line1.xValues = range(7)
line1.yValues = [1, 2, 4, 8, 16, 32, 64]
line1.label = "First Plot"
line1.lineStyle = "-"
line1.color = "red"

line2 = Line()
line2.xValues = range(7)
line2.yValues = [100, 90, 80, 70, 60, 50, 40]
line2.label = "Second Plot"
line2.lineStyle = "--"
line2.color = "blue"

plot = Plot()
plot.add(line1)
plot.add(line2)
plot.setXLabel("Shared X Axis")
plot.setYLabel("First Plot's Y Axis")
plot.setTwinX("Second Plot's Y Axis", 1)
plot.hasLegend()

plot.save("twinx.png")
示例#3
0
scatter2.color = "green"

scatter3 = Scatter()
scatter3.xValues = x
scatter3.yValues = surf
scatter3.label = "Original Surface"
scatter3.markerSize = 1
scatter3.color = "blue"

scatterPlot = Plot()
scatterPlot.add(scatter1)
scatterPlot.add(scatter2)

scatterPlot.xLabel = "Distance Along Cross Section"
scatterPlot.yLabel = "Surface Height"
scatterPlot.setTwinX("1st Derivative", 1)
scatterPlot.title = "Surface (filtered)"
scatterPlot.hasLegend()

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

# plot the filtered surface with the original surface
scatter1 = Scatter()
scatter1.xValues = x
scatter1.yValues = surfFiltered
scatter1.markerSize = 1
scatter1.label = "Filtered Surface"
scatter1.color = "black"