Qt 3D scatter graph: how can I adjust the scaling of an axis ?

  • Hi! I'm currently developing a Qt desktop application using the Q3DScatter class. I'm inspecting Qt's 3D Scatter example project and I tried to modify the data item set to plot my own data. The data is plotted except that one axis is not well scaled and my 3D plot looks really messy. I'm looking for a way to adjust this axis. I've tried to change the range and the segment count of the axis, I even tried to set the "AutoAdjustRange" of the axis to true, but nothing seemed to solve the problem.

    Would really appreciate some help.

    PS: Here's a screen capture of what my 3D scatter graph looks like (the "messy" axis is shown with the red arrow)

    0_1492278395501_Capture d’écran 2017-04-15 à 6.43.26 PM.png

  • I figured this out by creating a CustomFormatter class by subclassing QValue3DAxisFormatter and reimplementing some of its functions (I followed this tutorial). Then I set up my axis formatter to my custom formatter (m_graph->axisZ()->setFormatter(cf);).

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.