<div dir="ltr">SettingNumberOfColors and No. of values does give me a scalar bar lie the one shown in the attached screeshot!<br><br>I don&#39;t understad what you are looking for.<br><br>Have you set both value and label no.?<br>
<br>Jothy<br><br><div class="gmail_quote">On Fri, Feb 24, 2012 at 3:04 PM, Karl Merkley <span dir="ltr">&lt;<a href="mailto:karl@elemtech.com">karl@elemtech.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Setting the number of labels does help but it doesn&#39;t give me the discrete values on the scalar bar.    For example, if I have three discrete values .4, .5, 1.25.   The scalar bar displays .4 .825, 1.25.    The .825 appears to be just average of the minimum and the maximum for the three value case.<div>
<br></div><div>Looking the source code for vtkScalarBarActor::AllocateAndSizeLabels(...), it looks like the interior values of scalar bar are a function of  the range and the number of labels.  There is no way to specify the discrete values.    It looks like I will have to subclass vtkScalarBarActor and overload AllocateAndSizeLabels.  Fortunately, it is a virtual method!</div>
<div><br></div><div>   -- Karl</div><div><div><div></div><div class="h5"><br><div><div>On Feb 23, 2012, at 2:33 AM, Jothybasu Selvaraj wrote:</div><br><blockquote type="cite"><div dir="ltr">You could do that by<br><br>//For 10 labels<br>
<span style="color:rgb(0,128,0)">scalarBar-&gt;SetMaximumNumberOfColors(10);<br></span><span style="color:#008000">scalarBar-&gt;SetNumberOfLabels(10);</span><br>
<br>Jothy<br><br><div class="gmail_quote">On Thu, Feb 23, 2012 at 12:10 AM, Karl Merkley <span dir="ltr">&lt;<a href="mailto:karl@elemtech.com" target="_blank">karl@elemtech.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
I have a set of discrete values (thicknesses) that I want to describe with a scalar bar.   Each color has exactly one value associated with it.   When I set up my scalar bar it has a range defined by each color.    Is there a way to get a single label drawn at the center of the color range instead of labels at the tops and bottoms of each range?<br>


<br>
  Thanks,<br>
     Karl<br>
<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Jothy<br></div><br>
</div>
_______________________________________________<br>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br></div></div><div>
<span style="border-collapse:separate;color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><span style="border-collapse:separate;color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">
<span style="border-collapse:separate;color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">
<div>---------------------------</div><div>Karl Merkley, Ph.D.</div><div><br></div><div><span style="font-size:medium">Elemental Technologies, Inc.</span><span style="font-size:medium"><br></span><span style="font-size:medium">Computational Simulation Software, LLC</span><span style="font-size:medium"><br>
</span><span style="font-size:medium"><a href="http://www.csimsoft.com/" target="_blank">www.csimsoft.com</a></span><span style="font-size:medium"><br></span><span style="font-size:medium"><br></span><span style="font-size:medium">Office:  <a href="tel:1-801-756-1972%2C%20ext%201" value="+18017561972" target="_blank">1-801-756-1972, ext 1</a></span></div>
<div><br></div></div></span><br></div></span><br></span><br>
</div>
<br></div></div><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Jothy<br></div><br>
</div>