lava / matplotlib-cpp

Extremely simple yet powerful header-only C++ plotting library built on the popular matplotlib
MIT License
4.28k stars 1.12k forks source link

Axis formatting by converting exponential numbers to normal numbers #304

Open arunumd opened 2 years ago

arunumd commented 2 years ago

I am trying to reproduce the original python matplotlib functionality of being able to display fixed offsets in x, y, and z values in the chart axes to whole numbers. This question on stackoverflow, very well explains what I intend to do.

I have some representative Python code which does the job for me in matplotlib (Python). The following is the code:

        fig = plt.figure()
        fig.set_size_inches(10, 10)
        ax = fig.add_subplot(projection='3d')
        axis_formatter = ScalarFormatter(useOffset=False)
        ax.scatter(self.x, self.y, self.z, marker='o')
        ax.yaxis.set_major_formatter(axis_formatter)
        ax.xaxis.set_major_formatter(axis_formatter)
        ax.zaxis.set_major_formatter(axis_formatter)

Are there equivalent methods in matplotlib-cpp to achieve this same functionality?