mplot3D plot_surface colors

Hello

Are there some way to take out the gridlines from a surface in mplot3D
and get a smooth colour change?

Thanks

German

Smooth Gouraud shading on surface plots is being worked on, but is not yet implemented.

Mike

German Ocampo wrote:

···

Hello

Are there some way to take out the gridlines from a surface in mplot3D
and get a smooth colour change?

Thanks

German

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Mike

thanks for your answer. I will wait for this option.

regards

german

···

On Wed, Aug 26, 2009 at 3:45 PM, Michael Droettboom<mdroe@...86...> wrote:

Smooth Gouraud shading on surface plots is being worked on, but is not yet
implemented.

Mike

German Ocampo wrote:

Hello

Are there some way to take out the gridlines from a surface in mplot3D
and get a smooth colour change?

Thanks

German

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008
30-Day trial. Simplify your report design, integration and deployment - and
focus on what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

I think surface plot does not draw any gridlines by default (linewidth
set to 0). Maybe you're referring the artifacts between each surface
elements, as can be seen in the example below

http://matplotlib.sourceforge.net/examples/mplot3d/surface3d_demo.html

My guess is that they are artifacts of antialiasing that edges gets
somewhat transparent.

So, you may turn off antialiasing, but plot gets a bit ugly. Or you
may actually strokes the edges with their face colors.

See the example plot attached.

The second example is created with high resolution grid to demonstrate
smooth color variation (this is extremely slow to render though).

It may be better if mplot3d has option for this, but I'll leave it to
Reinier, the original author of mplot3d.

Micheal,
If my understanding is correct, we will see this artifacts even with
the Gouraud shading. What do you think?

Regards,

-JJ

ps. I'm resending this message with external link to images due to the
attachment size limit in mpl list.

http://dl.getdropbox.com/u/178748/mpl/mplo3d_test_lowres.png
http://dl.getdropbox.com/u/178748/mpl/mplo3d_test_hires.png

···

On Wed, Aug 26, 2009 at 6:22 AM, German Ocampo<gerocampo@...287...> wrote:

Hello

Are there some way to take out the gridlines from a surface in mplot3D
and get a smooth colour change?

Hi JJ,

Thanks for the examples! I indeed suspected the anti-aliasing as well.
I'll include an option for linecolors = facecolors soon (probably this
weekend); it seems to be a good solution.

After that I'll try to implement usage of the Gouraud shading,
although I fear that this will not look nice with
edgecolors=facecolors, so anti-aliasing might have to be turned off in
that case. Is it perhaps possible to only render the surface with AA
off?

Cheers,
Reinier

···

On Wed, Aug 26, 2009 at 5:03 PM, Jae-Joon Lee<lee.j.joon@...287...> wrote:

On Wed, Aug 26, 2009 at 6:22 AM, German Ocampo<gerocampo@...287...> wrote:

Hello

Are there some way to take out the gridlines from a surface in mplot3D
and get a smooth colour change?

I think surface plot does not draw any gridlines by default (linewidth
set to 0). Maybe you're referring the artifacts between each surface
elements, as can be seen in the example below

http://matplotlib.sourceforge.net/examples/mplot3d/surface3d_demo.html

My guess is that they are artifacts of antialiasing that edges gets
somewhat transparent.

So, you may turn off antialiasing, but plot gets a bit ugly. Or you
may actually strokes the edges with their face colors.

See the example plot attached.

The second example is created with high resolution grid to demonstrate
smooth color variation (this is extremely slow to render though).

It may be better if mplot3d has option for this, but I'll leave it to
Reinier, the original author of mplot3d.

Micheal,
If my understanding is correct, we will see this artifacts even with
the Gouraud shading. What do you think?

Regards,

-JJ

ps. I'm resending this message with external link to images due to the
attachment size limit in mpl list.

http://dl.getdropbox.com/u/178748/mpl/mplo3d_test_lowres.png
http://dl.getdropbox.com/u/178748/mpl/mplo3d_test_hires.png

--
Reinier Heeres
Tel: +31 6 10852639

Jae-Joon Lee wrote:

  

Hello

Are there some way to take out the gridlines from a surface in mplot3D
and get a smooth colour change?

Micheal,
If my understanding is correct, we will see this artifacts even with
the Gouraud shading. What do you think?
  

The Agg Gouraud function deals with these artifacts by oversizing the area by half a pixel, which is more or less equivalent to what the "edgecolor == facecolor" trick does, except with Gouraud shading the edgecolor is not constant, but interpolated. So, no, the artifacts will not be there. There are other inherent artifacts related to the triangulation itself, of course :wink:

Mike

···

On Wed, Aug 26, 2009 at 6:22 AM, German Ocampo<gerocampo@...287...> wrote:

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Reinier Heeres wrote:

Hi JJ,

Thanks for the examples! I indeed suspected the anti-aliasing as well.
I'll include an option for linecolors = facecolors soon (probably this
weekend); it seems to be a good solution.

No, not in general. There are two problems: it distorts the sizes and positions of the patches, very slightly, but enough that it might be a problem in some applications; and it does not work with alpha != 1.

Eric

Its great news that the 3D is receiving more polish :slight_smile:

After reading on wikipedia, wouldn’t it be nicier to have Phong reflection[1] instead of Gouraud?

Maybe it would be too hard, as the Gouraud seems to be implemented directly in Agg (from what others just said…)

Anyway, just a suggestion :wink:

[1] http://en.wikipedia.org/wiki/Phong_reflection_model

2009/8/26 Eric Firing <efiring@…2611…2…>

···

Reinier Heeres wrote:

Hi JJ,

Thanks for the examples! I indeed suspected the anti-aliasing as well.

I’ll include an option for linecolors = facecolors soon (probably this

weekend); it seems to be a good solution.

No, not in general. There are two problems: it distorts the sizes and

positions of the patches, very slightly, but enough that it might be a

problem in some applications; and it does not work with alpha != 1.

Eric


Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day

trial. Simplify your report design, integration and deployment - and focus on

what you do best, core application coding. Discover what’s new with

Crystal Reports now. http://p.sf.net/sfu/bobj-july


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

It’s important to note that we’re not, as far as I’m aware, considering
anything lighting or ray-tracing-like yet. I’m not sure that Phong
shading actually makes sense without doing that. The Gouraud shading
we’re in the process of implementing uses only explicit colors
specified in the plot, not any sort of light-source-calculated values.

Add perhaps more importantly, Gouraud is implemented in a number of
vector formats, including PDF and PS (though matplotlib doesn’t have
support for that yet, that’s coming…)

Mike

···

http://p.sf.net/sfu/bobj-julyMatplotlib-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/matplotlib-users

Michael Droettboom wrote:

It's important to note that we're not, as far as I'm aware, considering anything lighting or ray-tracing-like yet. I'm not sure that Phong shading actually makes sense without doing that. The Gouraud shading we're in the process of implementing uses only explicit colors specified in the plot, not any sort of light-source-calculated values.

Add perhaps more importantly, Gouraud is implemented in a number of vector formats, including PDF and PS (though matplotlib doesn't have support for that yet, that's coming...)

Mike

Mike: I did add some support for crude light-source shading a while back. It works directly on rgb values - see pylab_examples/shading_example.py.

-Jeff

···

On 08/26/2009 07:06 PM, Nicolas Bigaouette wrote:

Its great news that the 3D is receiving more polish :slight_smile:

After reading on wikipedia, wouldn't it be nicier to have Phong reflection[1] instead of Gouraud?

Maybe it would be too hard, as the Gouraud seems to be implemented directly in Agg (from what others just said...)

Anyway, just a suggestion :wink:

[1] http://en.wikipedia.org/wiki/Phong_reflection_model

2009/8/26 Eric Firing <efiring@…202… <mailto:efiring@…202…>>

    Reinier Heeres wrote:
    > Hi JJ,
    >
    > Thanks for the examples! I indeed suspected the anti-aliasing
    as well.
    > I'll include an option for linecolors = facecolors soon
    (probably this
    > weekend); it seems to be a good solution.

    No, not in general. There are two problems: it distorts the
    sizes and
    positions of the patches, very slightly, but enough that it might
    be a
    problem in some applications; and it does not work with alpha != 1.

    Eric

    ------------------------------------------------------------------------------
    Let Crystal Reports handle the reporting - Free Crystal Reports
    2008 30-Day
    trial. Simplify your report design, integration and deployment -
    and focus on
    what you do best, core application coding. Discover what's new with
    Crystal Reports now. http://p.sf.net/sfu/bobj-july
    _______________________________________________
    Matplotlib-users mailing list
    Matplotlib-users@lists.sourceforge.net
    <mailto:Matplotlib-users@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/matplotlib-users

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net <mailto:Matplotlib-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
  
------------------------------------------------------------------------

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users