Enabling/Disabling Color Map Log Scaling on Programmable Filter Can Produce Unexpected Scaling Behavior
Using a programmable filter that causes the color bar scale to cross zero will not recover gracefully from a (perhaps inadvertent) click of "log scaling" in the color map editor.
Note that without using the programmable filter, the steps outlined below produce expected behavior at all steps.
This issue has been encountered in ParaView 5.4.0 on OS X 10.11.6.
Steps to Reproduce
- Launch ParaView.
- Individually load (see attached)
block_2.vtk(i.e., do NOT load them as time step data) and Apply them.
- Create and Apply the following Filters->Data Analysis->Programmable Filter on both data sets (e.g., to compare their differences):
cd1 = inputs.CellData['my_data'] cd2 = inputs.CellData['my_data'] output.CellData.append(cd1 - cd2, 'difference')
- Select Coloring:
differenceto view the data. Note that the color bar runs from -2 to 2 (as expected).
- Edit color map and enable Use log scale when mapping data to colors. A warning will (expectedly) be thrown:
Generic Warning: In /Users/kitware/buildbot-slave/8275bd07/source-paraview/ParaViewCore/ServerManager/Rendering/vtkSMTransferFunctionProxy.cxx, line 176 Ranges not valid for log-space. Changed the range to (0.0002, 2).
- Dismiss warning. The color bar now (reasonably) runs from 2.0e-4 to 2.0e0.
- Disable Use log scale when mapping data to colors. The color bar still runs from 2.0e-4 to 2.0e0.
- Click Rescale to Data Range. The color bar now runs from 0 to 2.
Note that if we apply a Threshold to the Programmable Filter values and seek the range of differences, it correctly provides -2 to 2. However, plotting the Threshold and clicking Rescale to Data Range still shows a color bar running from 0 to 2.
Note also that if instead of using a programmable filter, a single block is plotted, log-scaling enabled, log-disabled disabled, and Rescale to Data Range applied, everything behaves as expected.