c++ - vtkAxis - remove decimal points from axis notation -
i need display value of axis without decimal points in vtkchart.
eg- if have values 2.31, 4.76, 7.39 etc.. want display them on axis 2, 5, 7. integers , not doubles or floats.
i tried using printf_notation on vtkaxis::setnotation(int notation), display single decimal point. there way achieve in chart using vtkaxis?
any appreciated. thanks.
mululu's comment correct. should work setlabelformat("%1.0f"), tick settings , notation according vtkaxis::setlabelformat documentation
get/set printf-style format string used when ticklabelalgorithm tick_simple , notation printf_notation.
i tried following , worked me. vtk 8.0 on windows:
axis->setnotation( vtkaxis::printf_notation ); axis->setticklabelalgorithm( vtkaxis::tick_simple ); axis->setlabelformat("%1.0f");
Comments
Post a Comment