Re: [Matplotlib-users] matplotlib 3D: interpolated shading

2011-10-05 Thread Holger Brandsmeier
Ben,

I would be very happy to have this functionality. I think this would
also make the 3D plots in the examples that matplot provides look a
good deal nicer.

Let me know if you have any updates on this.

-Holger

On Mon, Oct 3, 2011 at 21:18, Benjamin Root ben.r...@ou.edu wrote:


 On Fri, Sep 30, 2011 at 11:33 AM, Holger Brandsmeier
 holger.brandsme...@sam.math.ethz.ch wrote:

 Ben,

 On Fri, Sep 30, 2011 at 17:06, Benjamin Root ben.r...@ou.edu wrote:
  What values for rstride and cstride are you using?  By default,
  plot_surface() will sample every 10th point of the data array (for
  performance reasons).  Also, color interpoltion can be turned on by
  setting
  shade to True.

 I beleive I start to understand the underlying logic. If no color map
 is set and shading and antialiazing is set,  then indeed the surface
 is nicely and smoothly displayed. When I provide a color map, then I
 seem to be able to assign one color for the whole polygon. I also find
 something like that in the code.

 In my case I want the z-coordinate to determine the color. I want to
 use a colormap like jet and no transparency. If I don't use the
 colormap argument, then I get shading, however everything is blue with
 shading depending on a lightsource.I don't really need a lightsource,
 but I would like non-constant colors per polygon.


 Yes, you have the logic correct (and probably better explained than I could
 have done).  This actually was an issue raised a couple of months ago in a
 bit of a different context, but the solution wasn't entirely clear at that
 point.  However, looking at the code again (remember, I didn't write it
 originally, and it had next to no comments), I think I see a fairly simple
 solution.  If I allow for the user to specify a light source of None, then I
 could feed the data through a different function to shade the surface.  I
 will look into doing that, but it won't make it into the v1.1.0 release
 (slated for tomorrow).

 Cheers!
 Ben Root





-- 
Holger Brandsmeier, SAM, ETH Zürich
http://www.sam.math.ethz.ch/people/bholger

--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib 3D: interpolated shading

2011-10-05 Thread Ethan Gutmann
Holger, for what it is worth, you can hack this fairly easily. Run the
code twice once with colors, once with shading. Take the output from
both as images, the convert both images to HSV, the recombine the HS
components from the color version with the V component of the shaded
version. I haven't done this in matplotlib, but it worked great for me
in IDL.



On Oct 5, 2011, at 1:23 PM, Holger Brandsmeier
holger.brandsme...@sam.math.ethz.ch wrote:

 Ben,

 I would be very happy to have this functionality. I think this would
 also make the 3D plots in the examples that matplot provides look a
 good deal nicer.

 Let me know if you have any updates on this.

 -Holger

 On Mon, Oct 3, 2011 at 21:18, Benjamin Root ben.r...@ou.edu wrote:


 On Fri, Sep 30, 2011 at 11:33 AM, Holger Brandsmeier
 holger.brandsme...@sam.math.ethz.ch wrote:

 Ben,

 On Fri, Sep 30, 2011 at 17:06, Benjamin Root ben.r...@ou.edu wrote:
 What values for rstride and cstride are you using?  By default,
 plot_surface() will sample every 10th point of the data array (for
 performance reasons).  Also, color interpoltion can be turned on by
 setting
 shade to True.

 I beleive I start to understand the underlying logic. If no color map
 is set and shading and antialiazing is set,  then indeed the surface
 is nicely and smoothly displayed. When I provide a color map, then I
 seem to be able to assign one color for the whole polygon. I also find
 something like that in the code.

 In my case I want the z-coordinate to determine the color. I want to
 use a colormap like jet and no transparency. If I don't use the
 colormap argument, then I get shading, however everything is blue with
 shading depending on a lightsource.I don't really need a lightsource,
 but I would like non-constant colors per polygon.


 Yes, you have the logic correct (and probably better explained than I could
 have done).  This actually was an issue raised a couple of months ago in a
 bit of a different context, but the solution wasn't entirely clear at that
 point.  However, looking at the code again (remember, I didn't write it
 originally, and it had next to no comments), I think I see a fairly simple
 solution.  If I allow for the user to specify a light source of None, then I
 could feed the data through a different function to shade the surface.  I
 will look into doing that, but it won't make it into the v1.1.0 release
 (slated for tomorrow).

 Cheers!
 Ben Root





 --
 Holger Brandsmeier, SAM, ETH Zürich
 http://www.sam.math.ethz.ch/people/bholger

 --
 All the data continuously generated in your IT infrastructure contains a
 definitive record of customers, application performance, security
 threats, fraudulent activity and more. Splunk takes this data and makes
 sense of it. Business sense. IT sense. Common sense.
 http://p.sf.net/sfu/splunk-d2dcopy1
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Alpha channel in imshow, bug or gamma correction?

2011-10-05 Thread Feng Yu
Dear Lists,

I tried to draw a white block with alpha-channel gradient on top of black.
The result appears to be non-linear, and I think it is problematic.

image = ones((255, 255, 4), dtype='u1')
image[:, :, 0:3] = 255
image[:, :, 3] = arange(0, 255)[:, newaxis]
gca().set_axis_bgcolor('k')
imshow(image)

The color of the pixel with alpha = 128 is about (30, 30, 30).
We can confirm this with
cla()
image[:, :, 3] = 128
imshow(image)

On Inkscape, a white block with alpha = 128 on top of a black box gives a
final color of r,g,b=128, 128, 128.

I did a rough fit and apparently matplotlib is calculating the final pixel
brightness with (notice the original pixel is 0)

r = cr * (alpha / 255.) ** 3 , (same for g and b)

shouldn't it be r = cr * alpha / 255?

This affects matplotlib-1.0.1 and a not so recent copy of the git
master(ba4043a35d4c2).


Regards,

Yu
--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] 3D bar chart help!

2011-10-05 Thread Andrew C

Hello List Server,
 
I am trying to take a raster dataset, getting the center points, and the z 
value and trying to graph it in a 3D bar chart quite unsuccessfully.
 
My data looks like this: 
XCoord = [1,2,3,4]
YCoord = [1,2,3,4]
ZCoord = [12,14,4,26]
 
Those are the known locations, but there will be lots of more points when using 
actual data that forms a continuous surface over a small area.  
 
How do I create a 3D bar chart to represent the Z Value at each of those 
locations?  I saw in the help that you need to create a mesh grid, but I don't 
understand how to do that.  The help documents are vague on what the X,Y,Z 
values formats are as well.
 
 
 
  --
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] rotating x tick labels, bold labels with axislines toolkit???

2011-10-05 Thread Jae-Joon Lee
On Wed, Oct 5, 2011 at 11:50 AM, mdekauwe mdeka...@gmail.com wrote:
 Still haven't worked out the bold but I am sure there will be something on
 that page


Try

ax.axis[bottom].label.set_text(Test)
ax.axis[bottom].label.set_weight(bold)

IHTH,

-JJ

--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users