I want to display string values for ticks on x-axis in pyqtgraph. Right now I am unable to figure out how to do that.
Ex:
x = [\'a\', \'
I find it easiest to prepare a list of indices and a list of your strings and then zip them together:
ticks = [list(zip(range(5), ('a', 'b', 'c', 'd', 'e')))]
You can get an existing AxisItem of a PlotWidget like so:
pw = pg.PlotWidget()
xax = pw.getAxis('bottom')
And finally set the ticks of the axis like so:
xax.setTicks(ticks)
As far as I can tell, PlotWidgets automatically include 'bottom' and 'left' AxisItems, but you can create and add others if you desire.