mp-007 / kivy_matplotlib_widget

A fast matplotlib rendering for Kivy based on Kivy_matplotlib project and kivy scatter. Matplotlib used 'agg' backend
MIT License
35 stars 7 forks source link

Increasing/Customizing the number of reference point on the X axis #1

Closed kubapilch closed 2 years ago

kubapilch commented 2 years ago

Is there a way to increase the number of reference points on the axis?

I have this graph obraz

And I want to have more points on X axis so it's nor 4000 to 5000 byt 4100 4200 4300 etc.

mp-007 commented 2 years ago

You can increase the number of labels like this:

from matplotlib.ticker import MaxNLocator

...

self.ax1.xaxis.set_major_locator(MaxNLocator(nbins=10))

You can add this in your graph generator file if you want (note: nbins is the maximum number of labels).

Also if you want to customize your x axis label you can do something like this: https://stackoverflow.com/a/12608937

Almost all the things you can do with matplotlib can be done with my widget.