Discussion:
[PyX-user] bbox
r***@musiques-rb.org
2017-02-23 07:13:55 UTC
Permalink
2017.02.22

Moin-Moin (Salut, Hello, ...)

How to set the bbox in a canvas?

------------ meine nicht schöne Lösung:
2 sehr dünne Linien zufügen

sV = path.line(0.0, y0, 0.0, y0 + hauteur)
sH = path.line(0.0, y0, 22.0, y0)
cblanc.stroke(sV, [style.linewidth(0.002)])
cblanc.stroke(sH, [style.linewidth(0.002)])
--------------

a+

René
Michael J Gruber
2017-02-23 09:11:44 UTC
Permalink
Hi there,

you cannot set the bbox for a canvas - it is computed automatically from
its contents:

http://pyx.sourceforge.net/manual/canvas.html#canvas.canvas.bbox

It becomes relevant, though, only when you construct a page from the
canvas, which by defaults uses that bbox (possibly enlarged), but you
can tell the page constructor to use any bbox that you like:

http://pyx.sourceforge.net/manual/document.html#class-page

Note that when you write a canvas to a file "directly", the page (and
document) constructor gets called under the hood, and can pass a bbox
argument to the page constructor as described here:

http://pyx.sourceforge.net/manual/canvas.html#canvas.canvas.writeEPSfile

HTH.
Michael
Post by r***@musiques-rb.org
2017.02.22
Moin-Moin (Salut, Hello, ...)
How to set the bbox in a canvas?
2 sehr dünne Linien zufügen
sV = path.line(0.0, y0, 0.0, y0 + hauteur)
sH = path.line(0.0, y0, 22.0, y0)
cblanc.stroke(sV, [style.linewidth(0.002)])
cblanc.stroke(sH, [style.linewidth(0.002)])
--------------
a+
René
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
PyX-user mailing list
https://lists.sourceforge.net/lists/listinfo/pyx-user
Loading...