Mike Kharkov Mike Kharkov - 10 months ago 102
Python Question

Matplotlib. The scroll bar doesn't exist?

I have some Python and

library questions.

enter image description here


I want to remove the text in the bottom left corner (axex: x,y and the coords).


Can I set a scroll bar on the chart?

I want a fixed width chart where a horizontal scroll bar appears if the data is too large to fit in the fixed width.

Answer Source

You can add a scroll bar with

from matplotlib.widgets import Slider
import matplotlib.pyplot as plt

fig, ax = plt.subplots(figsize=(16, 12))
axframe = plt.axes([0.125, 0.1, 0.775, 0.03])
sframe = Slider(axframe, 'Point-Nr', 1, 200, valinit=1, valfmt='Nr.%d')

def update(val):
    ax.plot(int(sframe.val), int(sframe.val)*2, 'o-')


Regards Dr. Cobra