Hi Michael,

I am rather confused about some of the changes below. See there.
Btw, your changes also do not seem to be in SVN? At least, they
do not appear when I update my checkout.

Cheers,

        Jörg

On 14.12.12, [email protected] wrote:
> Revision: 3308
>           http://pyx.svn.sourceforge.net/pyx/?rev=3308&view=rev
> Author:   m-schindler
> Date:     2012-12-14 14:27:47 +0000 (Fri, 14 Dec 2012)
> Log Message:
> -----------
> fixed some little bugs in the density style of graphs
> 
> Modified Paths:
> --------------
>     trunk/pyx/pyx/graph/style.py
> 
> Modified: trunk/pyx/pyx/graph/style.py
> ===================================================================
> --- trunk/pyx/pyx/graph/style.py      2012-10-16 00:04:20 UTC (rev 3307)
> +++ trunk/pyx/pyx/graph/style.py      2012-12-14 14:27:47 UTC (rev 3308)
> @@ -162,7 +162,7 @@
>          return self.gradient.getcolor(vc)
>  
>      def donedrawpoints(self, privatedata, sharedata, graph):
> -        if self.keygraph is _autokeygraph:
> +        if self.keygraph is not None:
>              graph.layer("key").insert(privatedata.keygraph, 
> [graph.autokeygraphtrafo(privatedata.keygraph)])
>  
>  
> @@ -1976,23 +1976,23 @@
>                      if v1 is None:
>                          privatedata.vfixed[i] = v2
>                      elif abs(v1-v2) > self.epsilon:
> -                        raise ValueError("data must be in a plane for the 
> bitmap style")
> +                        raise ValueError("data must be in a plane for the 
> density style")
>  
>      def donedrawpoints(self, privatedata, sharedata, graph):
>          privatedata.keygraph.doaxes()
>  
>          values1 = pycompat.sorted(sharedata.values1.keys())
>          values2 = pycompat.sorted(sharedata.values2.keys())
> -        def equidistant(values):
> +        def check_equidistant(values):
>              l = len(values) - 1
>              if l < 1:
> -                raise ValueError("several data points required by the bitmap 
> style in each dimension")
> +                raise ValueError("several data points required by the 
> density style in each dimension")
>              range = values[-1] - values[0]
>              for i, value in enumerate(values):
>                  if abs(value - values[0] - i * range / l) > self.epsilon:
> -                    raise ValueError("data must be equidistant for the 
> bitmap style")
> -        equidistant(values1)
> -        equidistant(values2)
> +                    raise ValueError("data must be equidistant for the 
> density style")
> +        check_equidistant(values1)
> +        check_equidistant(values2)
>          needalpha = False
>          for value2 in values2:
>              for value1 in values1:
> @@ -2024,7 +2024,11 @@
>                  if not available:
>                      data.write(empty)
>                      continue
> -                c = privatedata.colors[value1][value2]
> +                try:
> +                    c = privatedata.colors[value1][value2]
> +                except KeyError:
> +                    data.write(empty)
> +                    continue
>                  c = self.color(privatedata, c)
>                  if needalpha:
>                      data.write(chr(255))
> @@ -2049,7 +2053,7 @@
>          privatedata.vfixed[sharedata.index2] = values2[0]-v2enlargement
>          vx4, vy4 = t.inverse().apply_pt(*graph.vpos_pt(*privatedata.vfixed))
>          if abs(vx4 - 1) > self.epsilon or abs(vy4 - 1) > self.epsilon:
> -            raise ValueError("invalid graph layout for bitmap style (bitmap 
> positioning by affine transformation failed)")
> +            raise ValueError("invalid graph layout for density style (bitmap 
> positioning by affine transformation failed)")
>  
>          p = path.path()
>          privatedata.vfixed[sharedata.index1] = 0
> @@ -2116,13 +2120,19 @@

The following things had already been fixed (in a simpler way) by André
in the brown pager bug changesets 3331 and 3332. Your changeset seems
to be refering to an older revision!?

>                  "/DeviceRGB": "RGB",
>                  "/DeviceCMYK": 
> "CMYK"}[self.gradient.getcolor(0).colorspacestring()]
>          data = cStringIO.StringIO()
> -        for i in builtinrange(self.resolution):
> -            c = self.gradient.getcolor(i*1.0/self.resolution)
> -            data.write(c.to8bitstring())
> -        i = bitmap.image(self.resolution, 1, mode, data.getvalue())
> +        if graph.flipped:
> +            for i in builtinrange(self.resolution):
> +                c = self.gradient.getcolor(i*1.0/self.resolution)
> +                data.write(c.to8bitstring())
> +            i = bitmap.image(self.resolution, 1, mode, data.getvalue())
> +        else:
> +            for i in builtinrange(self.resolution):
> +                c = self.gradient.getcolor(1.0-i*1.0/self.resolution)
> +                data.write(c.to8bitstring())
> +            i = bitmap.image(1, self.resolution, mode, data.getvalue())
>  
> -        llx_pt, lly_pt = graph.vpos_pt(0-0.5/(self.resolution-1))
> -        urx_pt, ury_pt = graph.vpos_pt(1+0.5/(self.resolution-1))
> +        llx_pt, lly_pt = graph.vpos_pt(0)
> +        urx_pt, ury_pt = graph.vpos_pt(1)
>          if graph.direction == "horizontal":
>              lly_pt -= 0.5*graph.height_pt
>              ury_pt += 0.5*graph.height_pt
> @@ -2132,7 +2142,7 @@
>  
>          t = trafo.trafo_pt(((0, urx_pt-llx_pt), (ury_pt-lly_pt, 0)), 
> (llx_pt, lly_pt))
>  
> -        c = canvas.canvas([canvas.clip(path.rect_pt(llx_pt, lly_pt, urx_pt, 
> ury_pt))])
> +        c = canvas.canvas([canvas.clip(path.rect_pt(llx_pt, lly_pt, 
> urx_pt-llx_pt, ury_pt-lly_pt))])
>          b = bitmap.bitmap_trafo(t, i)
>          c.insert(b)
>          graph.layer("filldata").insert(c)
> 
> This was sent by the SourceForge.net collaborative development platform, the 
> world's largest Open Source development site.
> 
> 
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> _______________________________________________
> PyX-checkins mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pyx-checkins
> 

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
PyX-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-devel

Reply via email to