Bruno Justino Praciano
Bruno Justino Praciano

Reputation: 552

Plot the correct point on x-axis

I'd like to put the correct value of the point on x-axis not use the approximated number. For example, using pandas and matplotlib.

enter image description here

I would like to show these indexes:

index_plot = [4.4,7.6,11.0,14.2,17.4,20.8,24.0,27.1]

not

[0,5,10,15,20,25]

Is it possible to do?

plot_4.plot.line(logy=True, style=['+-','o-','.-','s-','x-'],grid=True,figsize=(10,6)).legend(title='algorithm', bbox_to_anchor=(1, 1), fontsize=12)

plt.xlabel('Current', fontsize=14)
plt.ylabel('Beats per minute (BPM)', fontsize=14)
plt.show()

Upvotes: 1

Views: 39

Answers (1)

Quang Hoang
Quang Hoang

Reputation: 150735

You an do:

ax = plot_4.plot.line(logy=True, style=['+-','o-','.-','s-','x-'],grid=True,figsize=(10,6)).legend(title='algorithm', bbox_to_anchor=(1, 1), fontsize=12)

ax.set_xticks(plot_4.index)

Upvotes: 2

Related Questions