You can subscribe to this list here.
| 2003 |
Jan
(1) |
Feb
(2) |
Mar
(6) |
Apr
(11) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(15) |
Oct
(12) |
Nov
(11) |
Dec
(18) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(57) |
Feb
(16) |
Mar
(3) |
Apr
(14) |
May
(35) |
Jun
(41) |
Jul
(19) |
Aug
(25) |
Sep
(14) |
Oct
(36) |
Nov
(41) |
Dec
(29) |
| 2005 |
Jan
(44) |
Feb
(21) |
Mar
(17) |
Apr
(45) |
May
(23) |
Jun
(26) |
Jul
(30) |
Aug
(9) |
Sep
(120) |
Oct
(34) |
Nov
(17) |
Dec
(6) |
| 2006 |
Jan
(23) |
Feb
(56) |
Mar
(78) |
Apr
(14) |
May
(87) |
Jun
(52) |
Jul
(69) |
Aug
(41) |
Sep
(53) |
Oct
(37) |
Nov
(8) |
Dec
(17) |
| 2007 |
Jan
(32) |
Feb
(3) |
Mar
(21) |
Apr
(29) |
May
(14) |
Jun
(9) |
Jul
(30) |
Aug
(26) |
Sep
(6) |
Oct
(9) |
Nov
(7) |
Dec
(6) |
| 2008 |
Jan
(9) |
Feb
(19) |
Mar
(46) |
Apr
(44) |
May
(28) |
Jun
(32) |
Jul
(37) |
Aug
(14) |
Sep
(7) |
Oct
(3) |
Nov
(15) |
Dec
(3) |
| 2009 |
Jan
|
Feb
(6) |
Mar
(7) |
Apr
|
May
(20) |
Jun
(8) |
Jul
(5) |
Aug
(6) |
Sep
|
Oct
(45) |
Nov
(8) |
Dec
(20) |
| 2010 |
Jan
(3) |
Feb
(1) |
Mar
(12) |
Apr
|
May
(3) |
Jun
(12) |
Jul
(1) |
Aug
(2) |
Sep
(3) |
Oct
(11) |
Nov
(5) |
Dec
(6) |
| 2011 |
Jan
(4) |
Feb
|
Mar
|
Apr
(13) |
May
(9) |
Jun
(12) |
Jul
(12) |
Aug
(2) |
Sep
(11) |
Oct
(8) |
Nov
(2) |
Dec
(16) |
| 2012 |
Jan
(23) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(7) |
Nov
|
Dec
(3) |
| 2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
(2) |
May
(7) |
Jun
(6) |
Jul
(2) |
Aug
(12) |
Sep
|
Oct
(3) |
Nov
|
Dec
(3) |
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
| 2015 |
Jan
|
Feb
(5) |
Mar
(5) |
Apr
(1) |
May
(7) |
Jun
(28) |
Jul
(9) |
Aug
|
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(10) |
| 2016 |
Jan
(16) |
Feb
(6) |
Mar
|
Apr
|
May
(9) |
Jun
(5) |
Jul
(6) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
|
Feb
(5) |
Mar
(3) |
Apr
(4) |
May
(7) |
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
(5) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(6) |
Jul
(5) |
Aug
(8) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
(1) |
Feb
(5) |
Mar
(3) |
Apr
|
May
(9) |
Jun
(4) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2021 |
Jan
|
Feb
(1) |
Mar
(2) |
Apr
|
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2023 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
|
From: Maarten v. d. V. <m.h...@gm...> - 2020-05-07 13:01:55
|
Dear all, I wonder if you can help me. I would like to create multi page documents in Pyx. I am browsing through the documentation and the mailing list archive, but I am not able to connect all the pieces of information. I have tried following along: https://sourceforge.net/p/pyx/mailman/message/6193313/ <https://sourceforge.net/p/pyx/mailman/message/6193313/> c = canvas.canvas() c.text(0, 0, "Hello, world!") c.stroke(path.line(0, 0, 2, 0)) page = document.page(c, paperformat=paperformat.Letter) result = canvas.document(c) result.writePSfile("Whatever") But this gives me the error: AttributeError: 'Document' object has no attribute ‘page' Did the package change since this thread? (2007…) Is there a working example somewhere that I could use instead? Thanks, Maarten |
|
From: Frederico C W. <fr...@gm...> - 2020-03-26 12:13:49
|
HI André,
Thanks for the fixes, they worked like a charm.
On 26/03/2020 06:02, André Wobst wrote:
> Hi Frederico,
>
> the methods with _pt at the end, use coordinates in postscript points,
> whereas without _pt PyX uses PyX lengths. Those can be configured by
> the unit module. PyX lengths default to cm, but you might reconfigure
> it to mm to match your expectation.
>
> Please find this correction (to mm) together with a few other small
> fixes below. To my mind it now basically runs as you probably expect it.
>
> Best,
>
>
> André
>
> ------
> import mpy as np
> import math
> from pyx import *
>
> unit.set(defaultunit='mm')
>
> def vector(x1, y1, x2, y2, t, pos=0.5, distance=0.1):
> c = canvas.canvas()
> sz=1
> tg_s = (y2-y1) / (x2-x1)
> theta = math.atan(tg_s)
> dx = sz * math.cos( theta )
> dy = sz * math.sin( theta )
> #
> c.stroke(path.line(x1, y1, x2-dx, y2-dy),
> [style.linewidth(sz), color.rgb.black,
> deco.earrow([deco.stroked([color.rgb.black])],
> size=sz)] )
> c.text( x2+10, y2+10, t, [text.halign.boxcenter] )
> # c.insert(textbox)
> return c
>
> rect1 = path.path(path.moveto(0, 0), path.lineto(1, 0),
> path.moveto(1, 0), path.lineto(1, 1),
> path.moveto(1, 1), path.lineto(0, 1),
> path.moveto(0, 1), path.lineto(0, 0))
> rect2 = path.path(path.moveto(2, 0), path.lineto(3, 0),
> path.lineto(3, 1), path.lineto(2, 1),
> path.lineto(2, 0))
> rect3 = path.path(path.moveto(4, 0), path.lineto(5, 0),
> path.lineto(5, 1), path.lineto(4, 1) )
> # path.closepath())
>
> pt=path.path()
> c = canvas.canvas()
>
> nlin = 30
> mult = 10
> lmax = nlin * mult
> for ls in range( nlin ) :
> # pt = path.path( path.moveto(1,ls) , path.lineto(255,ls) ,
> path.closepath() )
> pt = path.path(path.moveto(0, ls*mult), path.lineto(lmax,ls*mult),
> path.moveto(ls*mult, 0), path.lineto(ls*mult,lmax) )
> c.stroke( pt , [style.linewidth.Thin] )
> c.text( ls*mult , 0 , str( ls ) )
>
>
> #for ls in range( nlin ) :
> # c.text( ls*mult , 0 , ls , [text.halign.boxcenter ])
> for I in range( 1 , 7 ) :
> c.insert( vector( 3 * mult , 1 * mult , 5 * mult , I * mult ,
> "$\\vec{v}$=(5, " + str(I) + ")" ) )
>
> #vt0 = path.path( path.moveto( vtorigx * mult , vtorigy * mult ) ,
> # path.lineto( (vtx + vtorigx) * mult ,
> (vty + vtorigy)*mult ) )
> #c.stroke( vt0 , [ style.linewidth.THICK , deco.earrow.normal ] )
> #c.stroke( pt , [style.linewidth.THICK] )
> #c.stroke(rect1, [style.linewidth.THICK])
> #c.stroke(rect2, [style.linewidth.THICK])
> #c.stroke(rect3, [style.linewidth.THICK])
>
> #c.writeEPSfile("pathitem")
> #c.writePDFfile("pathitem")
>
> c.writePDFfile("pathitem")
> quit()
>
>
> ------
>
> Am 26.03.20 um 00:22 schrieb Frederico C Wilhelms:
>> Howdy,
>>
>>
>> I'm trying PyX for the first time, and looking to adapt examples to my
>> need,
>>
>> but after some effort, couldn't get the text to appear on the canvas.
>>
>>
>> Thought it would write the text somewhere near the drawn vectors. .. but
>> it hasn't text anywhere.
>>
>>
>> Would appreciate some help here.
>>
>>
>> Thanks in advance.,
>>
>> Frederico C Wilhelms
>>
>>
>>
>> By the way., Debian , 64 bits , Python Python 3.7.3
>> , Pyx 0.15 ., installed by pip3 .,
>>
>>
>> *******
>>
>>
>>
>> mpy as np
>> import math
>> from pyx import *
>>
>>
>>
>> def vector(x1, y1, x2, y2, t, pos=0.5, distance=0.1):
>> c = canvas.canvas()
>> sz=1
>> tg_s = (y2-y1) / (x2-x1)
>> theta = math.atan(tg_s)
>> dx = sz * math.cos( theta )
>> dy = sz * math.sin( theta )
>> #
>> c.stroke(path.line(x1, y1, x2-dx, y2-dy),
>> [style.linewidth(sz), color.rgb.black,
>> deco.earrow([deco.stroked([color.rgb.black])],
>> size=sz)] )
>> c.text_pt( x2+10, y2+10, t, [text.halign.boxcenter] )
>> # c.insert(textbox)
>> return c
>>
>> rect1 = path.path(path.moveto(0, 0), path.lineto(1, 0),
>> path.moveto(1, 0), path.lineto(1, 1),
>> path.moveto(1, 1), path.lineto(0, 1),
>> path.moveto(0, 1), path.lineto(0, 0))
>> rect2 = path.path(path.moveto(2, 0), path.lineto(3, 0),
>> path.lineto(3, 1), path.lineto(2, 1),
>> path.lineto(2, 0))
>> rect3 = path.path(path.moveto(4, 0), path.lineto(5, 0),
>> path.lineto(5, 1), path.lineto(4, 1) )
>> # path.closepath())
>>
>> pt=path.path()
>> c = canvas.canvas()
>>
>> nlin = 30
>> mult = 10
>> lmax = nlin * mult
>> for ls in range( nlin ) :
>> # pt = path.path( path.moveto(1,ls) , path.lineto(255,ls) ,
>> path.closepath() )
>> pt = path.path(path.moveto(0, ls*mult), path.lineto(lmax,ls*mult),
>> path.moveto(ls*mult, 0),
>> path.lineto(ls*mult,lmax) )
>> c.stroke( pt , [style.linewidth.Thin] )
>> c.text( ls*mult , 0 , str( ls ) )
>>
>> #for ls in range( nlin ) :
>> # c.text( ls*mult , 0 , ls , [text.halign.boxcenter ])
>> for I in range( 1 , 7 ) :
>> c.insert( vector( 3 * mult , 1 * mult , 5 * mult , I * mult ,
>> repr( "$\vec{v}$=(5, " + str(I) + ")" ) ) )
>>
>> #vt0 = path.path( path.moveto( vtorigx * mult , vtorigy * mult ) ,
>> # path.lineto( (vtx + vtorigx) * mult , (vty
>> + vtorigy)*mult ) )
>> #c.stroke( vt0 , [ style.linewidth.THICK , deco.earrow.normal ] )
>> #c.stroke( pt , [style.linewidth.THICK] )
>> #c.stroke(rect1, [style.linewidth.THICK])
>> #c.stroke(rect2, [style.linewidth.THICK])
>> #c.stroke(rect3, [style.linewidth.THICK])
>>
>> #c.writeEPSfile("pathitem")
>> #c.writePDFfile("pathitem")
>>
>> c.writePDFfile("pathitem")
>> quit()
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> PyX-user mailing list
>> PyX...@li...
>> https://lists.sourceforge.net/lists/listinfo/pyx-user
>>
>
|
|
From: André W. <co...@wo...> - 2020-03-26 09:02:40
|
Hi Frederico,
the methods with _pt at the end, use coordinates in postscript points,
whereas without _pt PyX uses PyX lengths. Those can be configured by the
unit module. PyX lengths default to cm, but you might reconfigure it to
mm to match your expectation.
Please find this correction (to mm) together with a few other small
fixes below. To my mind it now basically runs as you probably expect it.
Best,
André
------
import mpy as np
import math
from pyx import *
unit.set(defaultunit='mm')
def vector(x1, y1, x2, y2, t, pos=0.5, distance=0.1):
c = canvas.canvas()
sz=1
tg_s = (y2-y1) / (x2-x1)
theta = math.atan(tg_s)
dx = sz * math.cos( theta )
dy = sz * math.sin( theta )
#
c.stroke(path.line(x1, y1, x2-dx, y2-dy),
[style.linewidth(sz), color.rgb.black,
deco.earrow([deco.stroked([color.rgb.black])], size=sz)] )
c.text( x2+10, y2+10, t, [text.halign.boxcenter] )
# c.insert(textbox)
return c
rect1 = path.path(path.moveto(0, 0), path.lineto(1, 0),
path.moveto(1, 0), path.lineto(1, 1),
path.moveto(1, 1), path.lineto(0, 1),
path.moveto(0, 1), path.lineto(0, 0))
rect2 = path.path(path.moveto(2, 0), path.lineto(3, 0),
path.lineto(3, 1), path.lineto(2, 1),
path.lineto(2, 0))
rect3 = path.path(path.moveto(4, 0), path.lineto(5, 0),
path.lineto(5, 1), path.lineto(4, 1) )
# path.closepath())
pt=path.path()
c = canvas.canvas()
nlin = 30
mult = 10
lmax = nlin * mult
for ls in range( nlin ) :
# pt = path.path( path.moveto(1,ls) , path.lineto(255,ls) ,
path.closepath() )
pt = path.path(path.moveto(0, ls*mult), path.lineto(lmax,ls*mult),
path.moveto(ls*mult, 0), path.lineto(ls*mult,lmax) )
c.stroke( pt , [style.linewidth.Thin] )
c.text( ls*mult , 0 , str( ls ) )
#for ls in range( nlin ) :
# c.text( ls*mult , 0 , ls , [text.halign.boxcenter ])
for I in range( 1 , 7 ) :
c.insert( vector( 3 * mult , 1 * mult , 5 * mult , I * mult ,
"$\\vec{v}$=(5, " + str(I) + ")" ) )
#vt0 = path.path( path.moveto( vtorigx * mult , vtorigy * mult ) ,
# path.lineto( (vtx + vtorigx) * mult , (vty
+ vtorigy)*mult ) )
#c.stroke( vt0 , [ style.linewidth.THICK , deco.earrow.normal ] )
#c.stroke( pt , [style.linewidth.THICK] )
#c.stroke(rect1, [style.linewidth.THICK])
#c.stroke(rect2, [style.linewidth.THICK])
#c.stroke(rect3, [style.linewidth.THICK])
#c.writeEPSfile("pathitem")
#c.writePDFfile("pathitem")
c.writePDFfile("pathitem")
quit()
------
Am 26.03.20 um 00:22 schrieb Frederico C Wilhelms:
> Howdy,
>
>
> I'm trying PyX for the first time, and looking to adapt examples to my
> need,
>
> but after some effort, couldn't get the text to appear on the canvas.
>
>
> Thought it would write the text somewhere near the drawn vectors. .. but
> it hasn't text anywhere.
>
>
> Would appreciate some help here.
>
>
> Thanks in advance.,
>
> Frederico C Wilhelms
>
>
>
> By the way., Debian , 64 bits , Python Python 3.7.3
> , Pyx 0.15 ., installed by pip3 .,
>
>
> *******
>
>
>
> mpy as np
> import math
> from pyx import *
>
>
>
> def vector(x1, y1, x2, y2, t, pos=0.5, distance=0.1):
> c = canvas.canvas()
> sz=1
> tg_s = (y2-y1) / (x2-x1)
> theta = math.atan(tg_s)
> dx = sz * math.cos( theta )
> dy = sz * math.sin( theta )
> #
> c.stroke(path.line(x1, y1, x2-dx, y2-dy),
> [style.linewidth(sz), color.rgb.black,
> deco.earrow([deco.stroked([color.rgb.black])], size=sz)] )
> c.text_pt( x2+10, y2+10, t, [text.halign.boxcenter] )
> # c.insert(textbox)
> return c
>
> rect1 = path.path(path.moveto(0, 0), path.lineto(1, 0),
> path.moveto(1, 0), path.lineto(1, 1),
> path.moveto(1, 1), path.lineto(0, 1),
> path.moveto(0, 1), path.lineto(0, 0))
> rect2 = path.path(path.moveto(2, 0), path.lineto(3, 0),
> path.lineto(3, 1), path.lineto(2, 1),
> path.lineto(2, 0))
> rect3 = path.path(path.moveto(4, 0), path.lineto(5, 0),
> path.lineto(5, 1), path.lineto(4, 1) )
> # path.closepath())
>
> pt=path.path()
> c = canvas.canvas()
>
> nlin = 30
> mult = 10
> lmax = nlin * mult
> for ls in range( nlin ) :
> # pt = path.path( path.moveto(1,ls) , path.lineto(255,ls) ,
> path.closepath() )
> pt = path.path(path.moveto(0, ls*mult), path.lineto(lmax,ls*mult),
> path.moveto(ls*mult, 0), path.lineto(ls*mult,lmax) )
> c.stroke( pt , [style.linewidth.Thin] )
> c.text( ls*mult , 0 , str( ls ) )
>
>
> #for ls in range( nlin ) :
> # c.text( ls*mult , 0 , ls , [text.halign.boxcenter ])
> for I in range( 1 , 7 ) :
> c.insert( vector( 3 * mult , 1 * mult , 5 * mult , I * mult ,
> repr( "$\vec{v}$=(5, " + str(I) + ")" ) ) )
>
> #vt0 = path.path( path.moveto( vtorigx * mult , vtorigy * mult ) ,
> # path.lineto( (vtx + vtorigx) * mult , (vty
> + vtorigy)*mult ) )
> #c.stroke( vt0 , [ style.linewidth.THICK , deco.earrow.normal ] )
> #c.stroke( pt , [style.linewidth.THICK] )
> #c.stroke(rect1, [style.linewidth.THICK])
> #c.stroke(rect2, [style.linewidth.THICK])
> #c.stroke(rect3, [style.linewidth.THICK])
>
> #c.writeEPSfile("pathitem")
> #c.writePDFfile("pathitem")
>
> c.writePDFfile("pathitem")
> quit()
>
>
>
>
>
>
> _______________________________________________
> PyX-user mailing list
> PyX...@li...
> https://lists.sourceforge.net/lists/listinfo/pyx-user
>
--
by _ _ _
/ \ \ / ) Dr. André Wobst, co...@wo..., https://www.wobsta.de
/ _ \ \/\/ / wobsta GmbH, Amselweg 22, 85716 Unterschleißheim, Germany
(_/ \_)_/\_/ Office: +49 (0)89 5480 3394, Mobile: +49 (0)160 9380 4217
|
|
From: Frederico C W. <fr...@gm...> - 2020-03-25 23:22:26
|
Howdy,
I'm trying PyX for the first time, and looking to adapt examples to my
need,
but after some effort, couldn't get the text to appear on the canvas.
Thought it would write the text somewhere near the drawn vectors. .. but
it hasn't text anywhere.
Would appreciate some help here.
Thanks in advance.,
Frederico C Wilhelms
By the way., Debian , 64 bits , Python Python 3.7.3
, Pyx 0.15 ., installed by pip3 .,
*******
mpy as np
import math
from pyx import *
def vector(x1, y1, x2, y2, t, pos=0.5, distance=0.1):
c = canvas.canvas()
sz=1
tg_s = (y2-y1) / (x2-x1)
theta = math.atan(tg_s)
dx = sz * math.cos( theta )
dy = sz * math.sin( theta )
#
c.stroke(path.line(x1, y1, x2-dx, y2-dy),
[style.linewidth(sz), color.rgb.black,
deco.earrow([deco.stroked([color.rgb.black])], size=sz)] )
c.text_pt( x2+10, y2+10, t, [text.halign.boxcenter] )
# c.insert(textbox)
return c
rect1 = path.path(path.moveto(0, 0), path.lineto(1, 0),
path.moveto(1, 0), path.lineto(1, 1),
path.moveto(1, 1), path.lineto(0, 1),
path.moveto(0, 1), path.lineto(0, 0))
rect2 = path.path(path.moveto(2, 0), path.lineto(3, 0),
path.lineto(3, 1), path.lineto(2, 1),
path.lineto(2, 0))
rect3 = path.path(path.moveto(4, 0), path.lineto(5, 0),
path.lineto(5, 1), path.lineto(4, 1) )
# path.closepath())
pt=path.path()
c = canvas.canvas()
nlin = 30
mult = 10
lmax = nlin * mult
for ls in range( nlin ) :
# pt = path.path( path.moveto(1,ls) , path.lineto(255,ls) ,
path.closepath() )
pt = path.path(path.moveto(0, ls*mult), path.lineto(lmax,ls*mult),
path.moveto(ls*mult, 0), path.lineto(ls*mult,lmax) )
c.stroke( pt , [style.linewidth.Thin] )
c.text( ls*mult , 0 , str( ls ) )
#for ls in range( nlin ) :
# c.text( ls*mult , 0 , ls , [text.halign.boxcenter ])
for I in range( 1 , 7 ) :
c.insert( vector( 3 * mult , 1 * mult , 5 * mult , I * mult ,
repr( "$\vec{v}$=(5, " + str(I) + ")" ) ) )
#vt0 = path.path( path.moveto( vtorigx * mult , vtorigy * mult ) ,
# path.lineto( (vtx + vtorigx) * mult , (vty
+ vtorigy)*mult ) )
#c.stroke( vt0 , [ style.linewidth.THICK , deco.earrow.normal ] )
#c.stroke( pt , [style.linewidth.THICK] )
#c.stroke(rect1, [style.linewidth.THICK])
#c.stroke(rect2, [style.linewidth.THICK])
#c.stroke(rect3, [style.linewidth.THICK])
#c.writeEPSfile("pathitem")
#c.writePDFfile("pathitem")
c.writePDFfile("pathitem")
quit()
|
|
From: Vignesh T G <vig...@gm...> - 2020-02-24 11:41:57
|
Hello André,
Yes you are right, the compression is switched on by default. By mistake, i
checked the size of a different file.
I have to reduce the size of the input data to the plot.
PS: Sorry for the repeated replies.
Regards
Vignesh
On Mon, Feb 24, 2020 at 5:01 PM Vignesh T G <vig...@gm...> wrote:
> Hello Michael and André,
>
> Thank you for the replies and sorry for not providing an example. I was
> able to reduce the file size using Michael's suggestion, and the script is
> given below
>
>
> j = graph.graphxy(width=8, height=8,
> x=graph.axis.lin(title=r"$\Delta y/R_o$ "),
> y=graph.axis.lin(title=r"$\Delta{V}/Uc$"),
> )
>
> j.plot([graph.data.values(x=x, y=v,
> title=r"$\Delta y/R$")],
> [graph.style.line([style.linestyle.dashed, style.linewidth.thin,
> color.rgb.black])]
> )
> j.writePDFfile('Eq_Behavior',write_compress=True)
>
> Regards
> Vignesh
>
>
>
> On Mon, Feb 24, 2020 at 4:28 PM André Wobst <co...@wo...> wrote:
>
>> Hi Vignesh,
>>
>> perfect answer by Michael already (thanks!). Just an additional remark:
>> The default is to compress the page content stream and j.writePDFfile
>> ('plot', write_compress=False) will disable the compression. So it will
>> become even bigger, but allows you to view the content in an editor.
>> Now, how to reduce the size? The only option is to try to reduce the
>> amount of data to be included ...
>>
>> Best,
>>
>>
>> André
>>
>> Am 24.02.20 um 11:40 schrieb Michael J Gruber via PyX-user:
>> > Hi Vignesh
>> >
>> > You didn't provide a complete example, but I assume that your "j" is a
>> > canvas.canvas instance, right?
>> > The writePDFfile method of canvas creates a document.page and calls
>> > document.document's writePFfile method for you. If you want to specify
>> > keyword arguments for the latter when you use canvas.writePDFfile,
>> > write them as "write_compress" etc.
>> >
>> > Michael
>> >
>> > Am Mo., 24. Feb. 2020 um 08:22 Uhr schrieb Vignesh T G <
>> vig...@gm...>:
>> >>
>> >> Hello Pyx Development Team and users,
>> >>
>> >> I am generating a simple line plot using pyx in 'pdf' file format.
>> Unfortunately, due to the data i have, the resulting file size is large. I
>> found in the manual, about the 'compress' function in the module document
>> but i don't know how to use it. Can someone help me in this regard?
>> >>
>> >> I tried "j.writePDFfile ('plot', compress=True, compresslevel=6)",
>> but i get an error message stating there is "an unexpected argument
>> compress and compresslevel"
>> >>
>> >> Thanks
>> >> Vignesh TG
>> >> _______________________________________________
>> >> PyX-user mailing list
>> >> PyX...@li...
>> >> https://lists.sourceforge.net/lists/listinfo/pyx-user
>> >
>> >
>> > _______________________________________________
>> > PyX-user mailing list
>> > PyX...@li...
>> > https://lists.sourceforge.net/lists/listinfo/pyx-user
>> >
>>
>> --
>> by _ _ _
>> / \ \ / ) Dr. André Wobst, co...@wo..., https://www.wobsta.de
>> / _ \ \/\/ / wobsta GmbH, Amselweg 22, 85716 Unterschleißheim, Germany
>> (_/ \_)_/\_/ Office: +49 (0)89 5480 3394, Mobile: +49 (0)160 9380 4217
>>
>>
|
|
From: André W. <co...@wo...> - 2020-02-24 11:40:21
|
Hi Vignesh,
perfect answer by Michael already (thanks!). Just an additional remark:
The default is to compress the page content stream and j.writePDFfile
('plot', write_compress=False) will disable the compression. So it will
become even bigger, but allows you to view the content in an editor.
Now, how to reduce the size? The only option is to try to reduce the
amount of data to be included ...
Best,
André
Am 24.02.20 um 11:40 schrieb Michael J Gruber via PyX-user:
> Hi Vignesh
>
> You didn't provide a complete example, but I assume that your "j" is a
> canvas.canvas instance, right?
> The writePDFfile method of canvas creates a document.page and calls
> document.document's writePFfile method for you. If you want to specify
> keyword arguments for the latter when you use canvas.writePDFfile,
> write them as "write_compress" etc.
>
> Michael
>
> Am Mo., 24. Feb. 2020 um 08:22 Uhr schrieb Vignesh T G <vig...@gm...>:
>>
>> Hello Pyx Development Team and users,
>>
>> I am generating a simple line plot using pyx in 'pdf' file format. Unfortunately, due to the data i have, the resulting file size is large. I found in the manual, about the 'compress' function in the module document but i don't know how to use it. Can someone help me in this regard?
>>
>> I tried "j.writePDFfile ('plot', compress=True, compresslevel=6)", but i get an error message stating there is "an unexpected argument compress and compresslevel"
>>
>> Thanks
>> Vignesh TG
>> _______________________________________________
>> PyX-user mailing list
>> PyX...@li...
>> https://lists.sourceforge.net/lists/listinfo/pyx-user
>
>
> _______________________________________________
> PyX-user mailing list
> PyX...@li...
> https://lists.sourceforge.net/lists/listinfo/pyx-user
>
--
by _ _ _
/ \ \ / ) Dr. André Wobst, co...@wo..., https://www.wobsta.de
/ _ \ \/\/ / wobsta GmbH, Amselweg 22, 85716 Unterschleißheim, Germany
(_/ \_)_/\_/ Office: +49 (0)89 5480 3394, Mobile: +49 (0)160 9380 4217
|
|
From: Vignesh T G <vig...@gm...> - 2020-02-24 11:31:56
|
Hello Michael and André,
Thank you for the replies and sorry for not providing an example. I was
able to reduce the file size using Michael's suggestion, and the script is
given below
j = graph.graphxy(width=8, height=8,
x=graph.axis.lin(title=r"$\Delta y/R_o$ "),
y=graph.axis.lin(title=r"$\Delta{V}/Uc$"),
)
j.plot([graph.data.values(x=x, y=v,
title=r"$\Delta y/R$")],
[graph.style.line([style.linestyle.dashed, style.linewidth.thin,
color.rgb.black])]
)
j.writePDFfile('Eq_Behavior',write_compress=True)
Regards
Vignesh
On Mon, Feb 24, 2020 at 4:28 PM André Wobst <co...@wo...> wrote:
> Hi Vignesh,
>
> perfect answer by Michael already (thanks!). Just an additional remark:
> The default is to compress the page content stream and j.writePDFfile
> ('plot', write_compress=False) will disable the compression. So it will
> become even bigger, but allows you to view the content in an editor.
> Now, how to reduce the size? The only option is to try to reduce the
> amount of data to be included ...
>
> Best,
>
>
> André
>
> Am 24.02.20 um 11:40 schrieb Michael J Gruber via PyX-user:
> > Hi Vignesh
> >
> > You didn't provide a complete example, but I assume that your "j" is a
> > canvas.canvas instance, right?
> > The writePDFfile method of canvas creates a document.page and calls
> > document.document's writePFfile method for you. If you want to specify
> > keyword arguments for the latter when you use canvas.writePDFfile,
> > write them as "write_compress" etc.
> >
> > Michael
> >
> > Am Mo., 24. Feb. 2020 um 08:22 Uhr schrieb Vignesh T G <
> vig...@gm...>:
> >>
> >> Hello Pyx Development Team and users,
> >>
> >> I am generating a simple line plot using pyx in 'pdf' file format.
> Unfortunately, due to the data i have, the resulting file size is large. I
> found in the manual, about the 'compress' function in the module document
> but i don't know how to use it. Can someone help me in this regard?
> >>
> >> I tried "j.writePDFfile ('plot', compress=True, compresslevel=6)", but
> i get an error message stating there is "an unexpected argument compress
> and compresslevel"
> >>
> >> Thanks
> >> Vignesh TG
> >> _______________________________________________
> >> PyX-user mailing list
> >> PyX...@li...
> >> https://lists.sourceforge.net/lists/listinfo/pyx-user
> >
> >
> > _______________________________________________
> > PyX-user mailing list
> > PyX...@li...
> > https://lists.sourceforge.net/lists/listinfo/pyx-user
> >
>
> --
> by _ _ _
> / \ \ / ) Dr. André Wobst, co...@wo..., https://www.wobsta.de
> / _ \ \/\/ / wobsta GmbH, Amselweg 22, 85716 Unterschleißheim, Germany
> (_/ \_)_/\_/ Office: +49 (0)89 5480 3394, Mobile: +49 (0)160 9380 4217
>
>
|
|
From: Michael J G. <mic...@us...> - 2020-02-24 10:40:22
|
Hi Vignesh
You didn't provide a complete example, but I assume that your "j" is a
canvas.canvas instance, right?
The writePDFfile method of canvas creates a document.page and calls
document.document's writePFfile method for you. If you want to specify
keyword arguments for the latter when you use canvas.writePDFfile,
write them as "write_compress" etc.
Michael
Am Mo., 24. Feb. 2020 um 08:22 Uhr schrieb Vignesh T G <vig...@gm...>:
>
> Hello Pyx Development Team and users,
>
> I am generating a simple line plot using pyx in 'pdf' file format. Unfortunately, due to the data i have, the resulting file size is large. I found in the manual, about the 'compress' function in the module document but i don't know how to use it. Can someone help me in this regard?
>
> I tried "j.writePDFfile ('plot', compress=True, compresslevel=6)", but i get an error message stating there is "an unexpected argument compress and compresslevel"
>
> Thanks
> Vignesh TG
> _______________________________________________
> PyX-user mailing list
> PyX...@li...
> https://lists.sourceforge.net/lists/listinfo/pyx-user
|
|
From: Vignesh T G <vig...@gm...> - 2020-02-24 07:22:14
|
Hello Pyx Development Team and users,
I am generating a simple line plot using pyx in 'pdf' file format.
Unfortunately, due to the data i have, the resulting file size is large. I
found in the manual, about the 'compress' function in the module document
but i don't know how to use it. Can someone help me in this regard?
I tried "j.writePDFfile ('plot', compress=True, compresslevel=6)", but i
get an error message stating there is "an unexpected argument compress and
compresslevel"
Thanks
Vignesh TG
|
|
From: Serge D. <ser...@ij...> - 2020-01-16 09:15:01
|
Hello, This is not a request for help in using PyX, so I hope it still has its place on this list. I made 'seplot' a small interface for PyX, to be able to use it from bash, or from python, with a simpler syntax than the whole thing. Typically, in bash : $ seplot data.txt Would yield a PyX-generated plot of data contained in data.txt. There are quite a few possibilities to meet real-world needs (if conditions, axis range, histograms...). Seplot can be installed through pip ( $ pip3 install seplot ) and downloaded from github : https://github.com/SergeDmi/Python-Tools/tree/master/seplot Hope this has some interest, Serge |
|
From: Gert-Ludwig I. <ger...@ph...> - 2019-08-05 20:01:15
|
Dear Alan, > C:\Program Files\Python38\lib\distutils\dist.py:274: UserWarning: > Unknown distribution option: 'python_requires' > warnings.warn(msg) > C:\Program Files\Python38\lib\distutils\dist.py:274: UserWarning: > Unknown distribution option: 'extras_require' > warnings.warn(msg) I had noticed this as well. It seems that setuptools should be used instead of distutils. I will prepare a PR and see what Jörg and André make out of it. For the moment, you can simply try to replace distutils.core by setuptools in the import. Best regards, Gert -- Gert-Ludwig Ingold email: Ger...@Ph... Institut für Physik Phone: +49-821-598-3234 Universität Augsburg Fax : +49-821-598-3222 D-86135 Augsburg WWW : www.physik.uni-augsburg.de/theo1/ingold Germany PGP : 86FF5A93, key available from homepage |
|
From: Alan I. <ala...@gm...> - 2019-08-05 19:34:57
|
On 8/5/2019 2:05 PM, Gert-Ludwig Ingold wrote: > Dear Alan, > > Am 03.08.19 um 21:33 schrieb Alan Isaac: >> Installing under Python 3.8 produces a number of invalid escape sequence >> warnings. > I have prepared a pull request to address this issue: > https://github.com/pyx-project/pyx/pull/5 It now installs without the warnings I mentioned. Thanks. I experience two other warnings installing from source (Python 3.8.0b3 on Win 10). C:\Program Files\Python38\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'python_requires' warnings.warn(msg) C:\Program Files\Python38\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'extras_require' warnings.warn(msg) To be clear: I am reporting these warnings fyi, but they do not seem to be affecting any aspect of the installation. Thanks for your quick fix, Alan |
|
From: Gert-Ludwig I. <ger...@ph...> - 2019-08-05 18:06:15
|
Dear Alan, Am 03.08.19 um 21:33 schrieb Alan Isaac: > Installing under Python 3.8 produces a number of invalid escape sequence > warnings. I have prepared a pull request to address this issue: https://github.com/pyx-project/pyx/pull/5 Best regards, Gert -- Gert-Ludwig Ingold email: Ger...@Ph... Institut für Physik Phone: +49-821-598-3234 Universität Augsburg Fax : +49-821-598-3222 D-86135 Augsburg WWW : www.physik.uni-augsburg.de/theo1/ingold Germany PGP : 86FF5A93, key available from homepage |
|
From: Michael J G. <mic...@us...> - 2019-08-05 13:47:50
|
Hi there, Py3.8k is more picky about escapes, some warnings will even turn into errors. In particular, this is about "unnecssary" escapes, i.e. escaped characters which need not be escaped. From a quick first glance at the reported files they fall into two categories: - LaTeX code such as \overline in a docstring which is not marked as raw string - commands such as \s in regex expressions which are not raw strings Cheers Michael Gert-Ludwig Ingold venit, vidit, dixit 2019-08-04 18:57:19: > Dear Alan, > > > My apologies for the missing details. > > I pulled the most recent code from Github > > and installed with the setup script. > > The warnings were issued (Python 3.8.0b3) when > > byte compiling texter.py, svgfile.py, t1file.py, > > and mathutils.py > > I had not understood that you had built PyX from the source > and can now confirm the behavior which you noted. > > Best regards, > Gert > > -- > Gert-Ludwig Ingold email: Ger...@Ph... > Institut für Physik Phone: +49-821-598-3234 > Universität Augsburg Fax : +49-821-598-3222 > D-86135 Augsburg WWW : www.physik.uni-augsburg.de/theo1/ingold > Germany PGP : 86FF5A93, key available from homepage > > > _______________________________________________ > PyX-user mailing list > PyX...@li... > https://lists.sourceforge.net/lists/listinfo/pyx-user |
|
From: Gert-Ludwig I. <ger...@ph...> - 2019-08-04 16:57:42
|
Dear Alan, > My apologies for the missing details. > I pulled the most recent code from Github > and installed with the setup script. > The warnings were issued (Python 3.8.0b3) when > byte compiling texter.py, svgfile.py, t1file.py, > and mathutils.py I had not understood that you had built PyX from the source and can now confirm the behavior which you noted. Best regards, Gert -- Gert-Ludwig Ingold email: Ger...@Ph... Institut für Physik Phone: +49-821-598-3234 Universität Augsburg Fax : +49-821-598-3222 D-86135 Augsburg WWW : www.physik.uni-augsburg.de/theo1/ingold Germany PGP : 86FF5A93, key available from homepage |
|
From: Alan I. <ala...@gm...> - 2019-08-04 16:18:15
|
My apologies for the missing details. I pulled the most recent code from Github and installed with the setup script. The warnings were issued (Python 3.8.0b3) when byte compiling texter.py, svgfile.py, t1file.py, and mathutils.py hth, Alan On 8/4/2019 2:47 AM, Gert-Ludwig Ingold wrote: > Dear Alan, > > Am 03.08.19 um 21:33 schrieb Alan Isaac: >> Installing under Python 3.8 produces a number of invalid escape sequence >> warnings. > > I was unable to reproduce your problem with Python 3.8.0b3. There was no > problem installing PyX 0.15 and it worked fine on a few examples. Can > you be more specific about the problems encountered? > > Best regards, > Gert > |
|
From: Gert-Ludwig I. <ger...@ph...> - 2019-08-04 07:01:45
|
Dear Alan, Am 03.08.19 um 21:33 schrieb Alan Isaac: > Installing under Python 3.8 produces a number of invalid escape sequence > warnings. I was unable to reproduce your problem with Python 3.8.0b3. There was no problem installing PyX 0.15 and it worked fine on a few examples. Can you be more specific about the problems encountered? Best regards, Gert -- Gert-Ludwig Ingold email: Ger...@Ph... Institut für Physik Phone: +49-821-598-3234 Universität Augsburg Fax : +49-821-598-3222 D-86135 Augsburg WWW : www.physik.uni-augsburg.de/theo1/ingold Germany PGP : 86FF5A93, key available from homepage |
|
From: Alan I. <ala...@gm...> - 2019-08-03 19:33:29
|
Installing under Python 3.8 produces a number of invalid escape sequence warnings. Cheers, Alan Isaac On 7/14/2019 8:06 AM, Joerg Lehmann via PyX-devel wrote: > Hi, > > We're very happy to announce the release of PyX 0.15! > > This release introduces a new text engine UnicodeEngine, which enables > simple typesetting with Type1 fonts without using TeX/LaTeX. The graph > axis texters have been adjusted to work on the UnicodeEngine, as well. > The exponential and mixed graph axis texters have been merged into the > new default texter. > > A couple of bug fixes are included in this release, as well. See the > full list of changes below. > > Furthermore, PyX' home has been moved to https://urldefense.proofpoint.com/v2/url?u=https-3A__pyx-2Dproject.org_&d=DwIFAw&c=U0G0XJAMhEk_X0GAGzCL7Q&r=FR4OfOwPIdSjpNUX7d7p26lh4cdTpLUy-9VDFkA1wBo&m=k-s2JG2e1uwXn1dN9_phSL6YJSoEReHKhBb1Pqyrv9Q&s=8KtHaAITLTAPTincuyj6GsrPnGoPk_ftoW3NZ0nb-nQ&e= . > The source code repository has been converted to git and is now hosted > at https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_pyx-2Dproject_pyx&d=DwIFAw&c=U0G0XJAMhEk_X0GAGzCL7Q&r=FR4OfOwPIdSjpNUX7d7p26lh4cdTpLUy-9VDFkA1wBo&m=k-s2JG2e1uwXn1dN9_phSL6YJSoEReHKhBb1Pqyrv9Q&s=MpuknayjKR0_Ma2el12xt7nqkOclg413LwcT512j4oc&e= . > > Happy PyXing, > > André and Jörg > > ------------------------------------------------------------------------ > > 0.15 (2019/07/14): > - text module: > - introduce UnicodeEngine > - MultiEngineText to express combined text data for TeX based > engines and the new UnicodeEngine > - Text and StackedText classes for simple typesetting operations on > UnicodeEngine text > - rename TexRunner and LatexRunner to TexEngine and LatexEngine > - rename cls argument of text.set to engine (with fallback and > deprecation warning in place) > - improve error handling when input cannot be encoded by texenc > - add support for virtual fonts in virtual fonts > - font maps: treat font files without extension as Type 1 (to > prevent warnings occuring especially with Minion or Libertine > fonts) > - fix UnicodeDecodeError for invalid character responses by > TeX/LaTeX (reported by Gert Ingold) > - new examples: > - non-ASCII TeX encoding > - t1font: > - use integers in auto-guessed font descriptors to prevent an > issue in pdftex (reported by Michael Hartmann) > - fix typo: ItalicAngles -> ItalicAngle (thanks to Ross Moore) > - graph.axis.texter: > - unify exponential and mixed texter to default texter > - use MultiEngineText in all texters (decimal, default, factional) > - pdfwriter, pswriter, svgwriter: > - removed underscore in PS and PDF and SVG writer options > strip_fonts, text_as_path, mesh_as_bitmap, > mesh_as_bitmap_resolution > (new: stripfonts, textaspath, meshasbitmap and > meshasbitmapresolution) to prevent ambiquity with write_ > prefixes. > - Fix color output in SVG (reported by Michael Hartmann) > - deformer: > - Fix parallel deformer for empty normsubpaths (thanks to > Michael J Gruber) > - graph.style: > - Use RGBA instead of ARGB in the bitmap fallback of > graph.style.density > Fix saving SVG as supported modes are limited (thanks to > Michael J Gruber) > - pattern: > - inject default linewidth (reported by Michael J Gruber) > - version control: > - switched to git on 2018/07/16 with main repository on GitHub > > > _______________________________________________ > PyX-devel mailing list > PyX...@li... > https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.sourceforge.net_lists_listinfo_pyx-2Ddevel&d=DwIFAw&c=U0G0XJAMhEk_X0GAGzCL7Q&r=FR4OfOwPIdSjpNUX7d7p26lh4cdTpLUy-9VDFkA1wBo&m=k-s2JG2e1uwXn1dN9_phSL6YJSoEReHKhBb1Pqyrv9Q&s=PeUpPlS1l3cEykNmQuQcIAwfrILmkj9EcCw8s7ZYk6Y&e= > |
|
From: Michael J G. <mic...@us...> - 2019-07-09 10:09:47
|
So, I finally figured out how to add stuff to the gallery. Can't say that I'm overly thrilled. For example, I see no way to control the bounding box (no, struts don't count) or scale of the nbviewer output. My local nbviewer as well as the hosted one give me svg for the cell output so that I have to create the png preview for the gallery manually. Oh well. Doing this directly on github (binder/nbviewer) would be much easier. I guess my next project will be a mirror for the examples and the gallery... In any case, "parallel" can be considered to be an example which you should grasp before wrapping your head around the "knot" example. I guess the gallery is really meant as a showcase of things which PyX can do; in the current state of PyX "development", it's maybe our only way of adding examples. BTW: If you run "parallel" yourself and try to enlarge the bounding box you get the funny effect that bboxenlarge=0 and bboxenlarge=0.2 lead to the same clipping on the left (while the bbox is enlarged vertically), only larger bboxenlarge values enlarge the box on the left. I haven't found the root cause yet. Am So., 7. Juli 2019 um 16:44 Uhr schrieb Michael J Gruber <mic...@us...>: > > http://pyx.sourceforge.net/examples/drawing2/parallel.html > > should give you a good example. You can tweak the construction of the > parallel further (as indicated in the text), by specifying what to do > with corners. > Also, remember that you can decorate a path without stroking it > ("draw" without stroke/fill), and that you deform a path and then work > with the deformed path > (http://pyx.sourceforge.net/manual/deformer.html#deformer.deformer.deform): > In the example, the deformed path (which is stroked in blue) would be > > deformer.parallel(0.2).deform(p) > > which you use to build upon. > > > Am Sa., 6. Juli 2019 um 17:17 Uhr schrieb S Joshua Swamidass > <swa...@gm...>: > > > > Rather, it seem it should be possible with the deformer module perhaps? What would such code look like? > > > > On Sat, Jul 6, 2019 at 10:15 AM S Joshua Swamidass <swa...@gm...> wrote: > >> > >> Is there any easy way to make a curved path line that is adjacent/non-overlapping metapost to another curved path? It seems this should be possible with the deco somehow. Thank you. > >> > >> > >> > > _______________________________________________ > > PyX-user mailing list > > PyX...@li... > > https://lists.sourceforge.net/lists/listinfo/pyx-user |
|
From: Michael J G. <mic...@us...> - 2019-07-07 14:45:06
|
http://pyx.sourceforge.net/examples/drawing2/parallel.html should give you a good example. You can tweak the construction of the parallel further (as indicated in the text), by specifying what to do with corners. Also, remember that you can decorate a path without stroking it ("draw" without stroke/fill), and that you deform a path and then work with the deformed path (http://pyx.sourceforge.net/manual/deformer.html#deformer.deformer.deform): In the example, the deformed path (which is stroked in blue) would be deformer.parallel(0.2).deform(p) which you use to build upon. Am Sa., 6. Juli 2019 um 17:17 Uhr schrieb S Joshua Swamidass <swa...@gm...>: > > Rather, it seem it should be possible with the deformer module perhaps? What would such code look like? > > On Sat, Jul 6, 2019 at 10:15 AM S Joshua Swamidass <swa...@gm...> wrote: >> >> Is there any easy way to make a curved path line that is adjacent/non-overlapping metapost to another curved path? It seems this should be possible with the deco somehow. Thank you. >> >> >> > _______________________________________________ > PyX-user mailing list > PyX...@li... > https://lists.sourceforge.net/lists/listinfo/pyx-user |
|
From: S J. S. <swa...@gm...> - 2019-07-06 15:17:15
|
Rather, it seem it should be possible with the deformer module perhaps? What would such code look like? On Sat, Jul 6, 2019 at 10:15 AM S Joshua Swamidass <swa...@gm...> wrote: > Is there any easy way to make a curved path line that is > adjacent/non-overlapping metapost to another curved path? It seems this > should be possible with the deco somehow. Thank you. > > > > |
|
From: S J. S. <swa...@gm...> - 2019-07-06 15:15:45
|
Is there any easy way to make a curved path line that is adjacent/non-overlapping metapost to another curved path? It seems this should be possible with the deco somehow. Thank you. |
|
From: S J. S. <swa...@gm...> - 2019-07-06 15:14:04
|
Thanks. This is really helpful. I do recommend it be added to the documentation. Please do. S Joshua Swamidass http://swami.wustl.edu/ On Fri, Jun 14, 2019 at 8:50 AM Michael J Gruber via PyX-user < pyx...@li...> wrote: > Am Fr., 14. Juni 2019 um 15:09 Uhr schrieb Gert-Ludwig Ingold > <ger...@ph...>: > > > > On 14.06.19 15:04, Michael J Gruber via PyX-user wrote: > > > > > ...). Just don't decorate a closed path with a gradient. I'll attach a > > > small example. > > > > It might be a good idea to add this example to the PyX gallery. > > > > Hi Gert, > > I need to fix a few bugs first :) > > I knew that deco.colorgradient reverses the path - I just don't know > why. The code seems rather inefficient, splitting the path N times for > steps=N rather than doing one split for the list of parameters. I > don't know why, either. I even suspected that it misses one color > patch at the end, but it appears gradients take care of that (mapping > N-1 to the end color). Nothing to fix here. > > Investigating that I noticed that one should draw the path, not stroke > it, since the decoration strokes already. Otherwise you may notice a > small hairline around the gradient (decoration) stroke stemming from > the stroke being decorated. > > Also, gradient filling a closed path sems to be such a common thing - > there should be a decorator for that, taking a gradient and a path or > direction vector, with the decorator figuring out the scaling (and > linewidth) for the gradient path and stroking it to a canvas clipped > by the path being gradient fill decorated :) > > Cheers > Michael > > > _______________________________________________ > PyX-user mailing list > PyX...@li... > https://lists.sourceforge.net/lists/listinfo/pyx-user > |
|
From: Michael J G. <mic...@us...> - 2019-06-14 13:50:53
|
Am Fr., 14. Juni 2019 um 15:09 Uhr schrieb Gert-Ludwig Ingold <ger...@ph...>: > > On 14.06.19 15:04, Michael J Gruber via PyX-user wrote: > > > ...). Just don't decorate a closed path with a gradient. I'll attach a > > small example. > > It might be a good idea to add this example to the PyX gallery. > Hi Gert, I need to fix a few bugs first :) I knew that deco.colorgradient reverses the path - I just don't know why. The code seems rather inefficient, splitting the path N times for steps=N rather than doing one split for the list of parameters. I don't know why, either. I even suspected that it misses one color patch at the end, but it appears gradients take care of that (mapping N-1 to the end color). Nothing to fix here. Investigating that I noticed that one should draw the path, not stroke it, since the decoration strokes already. Otherwise you may notice a small hairline around the gradient (decoration) stroke stemming from the stroke being decorated. Also, gradient filling a closed path sems to be such a common thing - there should be a decorator for that, taking a gradient and a path or direction vector, with the decorator figuring out the scaling (and linewidth) for the gradient path and stroking it to a canvas clipped by the path being gradient fill decorated :) Cheers Michael |
|
From: Gert-Ludwig I. <ger...@ph...> - 2019-06-14 13:09:39
|
On 14.06.19 15:04, Michael J Gruber via PyX-user wrote: > ...). Just don't decorate a closed path with a gradient. I'll attach a > small example. It might be a good idea to add this example to the PyX gallery. Best regards, Gert -- Gert-Ludwig Ingold email: Ger...@Ph... Institut für Physik Phone: +49-821-598-3234 Universität Augsburg Fax : +49-821-598-3222 D-86135 Augsburg WWW : www.physik.uni-augsburg.de/theo1/ingold Germany PGP : 86FF5A93, key available from homepage |