<div dir="ltr">There might be other settings for the mapper that are needed in addition to SetArrayName().  Take a look at the docs for vtkMapper, it has lots of methods related to scalars.<div><div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 1, 2018 at 7:53 AM, Ruben Di Battista <span dir="ltr"><<a href="mailto:rubendibattista@gmail.com" target="_blank">rubendibattista@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello David, <div><br></div><div>thanks for your answer. <br><br>I changed my `show` method like this: <br><br></div><div><span class=""><div><font face="monospace, monospace">    def show(self):</font></div><div><font face="monospace, monospace">        # Render Window</font></div><div><font face="monospace, monospace">        rw = vtk.vtkRenderWindow()</font></div><div><font face="monospace, monospace">        rw.SetSize(800, 800)</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">        # Defining Bounds of Viewports</font></div><div><font face="monospace, monospace">        xmins = [0, 0.5]</font></div><div><font face="monospace, monospace">        xmaxs = [0.5, 1]</font></div><div><font face="monospace, monospace">        ymins = [0, 0]</font></div><div><font face="monospace, monospace">        ymaxs = [1, 1]</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">        # Curvature Types</font></div><div><font face="monospace, monospace">        curv_types = ['Mean_Curvature', 'Gauss_Curvature']</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">        for i in six.moves.range(2):</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">            render = vtk.vtkRenderer()</font></div><div><font face="monospace, monospace">            rw.AddRenderer(render)</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">            # Mean Curvature View</font></div><div><font face="monospace, monospace">            render.SetViewport(xmins[i], ymins[i], xmaxs[i], ymaxs[i])</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">            # Create mapper</font></div><div><font face="monospace, monospace">            mapper = vtk.vtkPolyDataMapper()</font></div></span><div><font face="monospace, monospace">            mapper.SetInputData(self.<wbr>surface)</font></div><div><font face="monospace, monospace">            mapper.Update()  # Probably useless</font></div><div><font face="monospace, monospace">            mapper.SetScalarRange(-1, 1)</font></div><div><font face="monospace, monospace">            mapper.SetArrayName(curv_<wbr>types[0])</font></div><span class=""><div><font face="monospace, monospace">            mapper.Update()</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">            # ColorBar</font></div><div><font face="monospace, monospace">            color_bar = vtk.vtkScalarBarActor()</font></div><div><font face="monospace, monospace">            color_bar.SetLookupTable(<wbr>mapper.GetLookupTable())</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">            # Surface Actor</font></div><div><font face="monospace, monospace">            actor = vtk.vtkActor()</font></div><div><font face="monospace, monospace">            actor.SetMapper(mapper)</font></div><div><font face="monospace, monospace">            actor.GetProperty().<wbr>EdgeVisibilityOn()</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">            render.AddActor(actor)</font></div><div><font face="monospace, monospace">            render.AddActor2D(color_bar)</font></div><div><font face="monospace, monospace"><br></font></div></span><div><font face="monospace, monospace">            import ipdb</font></div><div><font face="monospace, monospace">            ipdb.set_trace()</font></div><span class=""><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">        # Render Window Interactor</font></div><div><font face="monospace, monospace">        rwi = vtk.vtkRenderWindowInteractor(<wbr>)</font></div><div><font face="monospace, monospace">        rwi.SetRenderWindow(rw)</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">        rwi.Initialize()</font></div><div><font face="monospace, monospace">        rwi.Start()</font></div></span></div><div><br></div><div>but it's not working. </div><div><br></div><div>Actually stopping the execution at the first iteration of the `for` loop, and then triggering rwi.Initialize() and rwi.Start() just after the first iteration still shows that the Mapper is rendering the last scalar added to the `PolyData` and not the one specified by `mapper.SetArrayName`.</div><div><br></div><div>In my previous email, at least, if I stopped the execution at the first iteration and then manually triggering the rendering, was correctly showing the first scalar (i.e. `Mean_Curvatures`).</div><div><br></div><div>I'm still attaching the complete example.</div></div><div class="HOEnZb"><div class="h5"><br></div></div></blockquote></div></div></div></div></div>