Skip to content

bug fix for pcolorfast to allow direct color #1317

Closed
@2sn

Description

@2sn

Could you please change in the current branch in

axes.py, line 7582
(Axes.pcolorfast)

      nr, nc = C.shape

to
nr, nc = C.shape[:2]

this way one can pass [nx,ny,3] or [nx,ny,4] arrays to the routine - for
which the PcolorImage it calls is made (style == "pcolorimage")

-Alexander

From e555f98ca915eb89c7df1cff21261efb506fc29a Mon Sep 17 00:00:00 2001
From: Alexander Heger matplotlib@2sn.net
Date: Fri, 28 Sep 2012 15:08:27 +1000
Subject: [PATCH] BF - fix pcolor fast to allow direct color


lib/matplotlib/axes.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py
index 56017a2..6a4a87d 100644
--- a/lib/matplotlib/axes.py
+++ b/lib/matplotlib/axes.py
@@ -7582,7 +7582,7 @@ class Axes(martist.Artist):
if norm is not None: assert(isinstance(norm, mcolors.Normalize))

     C = args[-1]
  •    nr, nc = C.shape
    
  •    nr, nc = C.shape[:2]
     if len(args) == 1:
         style = "image"
         x = [0, nc]
    
    --
    1.7.11.4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions