Ejemplo n.º 1
0
def test_gpar():
    g = grid.gpar(col='blue')
Ejemplo n.º 2
0
    vp = grid.viewport(**{'layout.pos.col': col_i + 1, 'layout.pos.row': 2})
    pp = gp + \
        ggplot2.aes_string(x='%s(carat)' % trans, y='%s(price)' % trans) + \
        ggplot2.geom_point(alpha = 0.1, size = 1) + \
        ggplot2.ggtitle("%s(<variable>)" % trans)
    pp.plot(vp=vp)

#-- ggplot2mtcarscoordtrans-end

#-- ggplot2mtcarscoordtransannot-begin
vp = grid.viewport(**{'layout.pos.col': 2, 'layout.pos.row': 1})
grid.rect(x=grid.unit(0.7, "npc"),
          y=grid.unit(0.2, "npc"),
          width=grid.unit(0.1, "npc"),
          height=grid.unit(0.1, "npc"),
          gp=grid.gpar(fill="red"),
          vp=vp).draw()
#-- ggplot2mtcarscoordtransannot-end

grdevices.dev_off()

grdevices.png('../../_static/graphics_grid.png',
              width=612,
              height=612,
              antialias="subpixel",
              type="cairo")
#-- grid-begin
grid.newpage()
# create a rows/columns layout
lt = grid.layout(2, 3)
vp = grid.viewport(layout=lt)
Ejemplo n.º 3
0
   vp = grid.viewport(**{'layout.pos.col':col_i+1, 'layout.pos.row': 2})
   pp = gp + \
       ggplot2.aes_string(x='%s(carat)' % trans, y='%s(price)' % trans) + \
       ggplot2.geom_point(alpha = 0.1, size = 1) + \
       ggplot2.ggtitle("%s(<variable>)" % trans)   
   pp.plot(vp = vp)

#-- ggplot2mtcarscoordtrans-end

#-- ggplot2mtcarscoordtransannot-begin
vp = grid.viewport(**{'layout.pos.col':2, 'layout.pos.row': 1})
grid.rect(x = grid.unit(0.7, "npc"),
          y = grid.unit(0.2, "npc"),
          width = grid.unit(0.1, "npc"),
          height = grid.unit(0.1, "npc"),
          gp = grid.gpar(fill = "red"),
          vp = vp).draw()
#-- ggplot2mtcarscoordtransannot-end

grdevices.dev_off()



grdevices.png('../../_static/graphics_grid.png',
              width = 612, height = 612, antialias="subpixel", type="cairo")
#-- grid-begin
grid.newpage()
# create a rows/columns layout
lt = grid.layout(2, 3)
vp = grid.viewport(layout = lt)
# push it the plotting stack