Example #1
0
def test_Patch():
    glyph = Patch()
    assert glyph.x == "x"
    assert glyph.y == "y"
    yield check_fill, glyph
    yield check_line, glyph
    yield check_props, glyph, ["x", "y"], FILL, LINE
Example #2
0
         cy0="yp01",
         cx1="xm01",
         cy1="ym01",
         line_color="#D95F02",
         line_width=2)),
 ("line", Line(x="x", y="y", line_color="#F46D43")),
 ("multi_line",
  MultiLine(xs="xs", ys="ys", line_color="#8073AC", line_width=2)),
 ("oval",
  Oval(x="x",
       y="y",
       width=screen(15),
       height=screen(25),
       angle=-0.7,
       fill_color="#1D91C0")),
 ("patch", Patch(x="x", y="y", fill_color="#A6CEE3")),
 ("patches", Patches(xs="xs", ys="ys", fill_color="#FB9A99")),
 ("quad",
  Quad(left="x", right="xm01", top="y", bottom="ym01",
       fill_color="#B3DE69")),
 ("quadratic",
  Quadratic(x0="x",
            y0="y",
            x1="xp02",
            y1="y",
            cx="xp01",
            cy="yp01",
            line_color="#4DAF4A",
            line_width=3)),
 ("ray",
  Ray(x="x",
Example #3
0
        times=[dt.time(11, 30)] * 3,
        texts=["CST (UTC+1)", "CEST (UTC+2)", "CST (UTC+1)"],
    ))

xdr = DataRange1d(sources=[source.columns("dates")])
ydr = DataRange1d(sources=[source.columns("sunrises", "sunsets")])

title = "Daylight Hours - Warsaw, Poland"
plot = Plot(title=title,
            data_sources=[source, patch1_source, patch2_source, text_source],
            x_range=xdr,
            y_range=ydr,
            width=800,
            height=400)

patch1 = Patch(x="dates", y="times", fill_color="skyblue", fill_alpha=0.8)
patch1_glyph = Glyph(data_source=patch1_source,
                     xdata_range=xdr,
                     ydata_range=ydr,
                     glyph=patch1)
plot.renderers.append(patch1_glyph)

patch2 = Patch(x="dates", y="times", fill_color="orange", fill_alpha=0.8)
patch2_glyph = Glyph(data_source=patch2_source,
                     xdata_range=xdr,
                     ydata_range=ydr,
                     glyph=patch2)
plot.renderers.append(patch2_glyph)

line1 = Line(x="dates", y="sunrises", line_color="yellow", line_width=2)
line1_glyph = Glyph(data_source=source,
Example #4
0
 def setUp(self):
     from bokeh.glyphs import Patch
     self.test_patch = Patch()