Search code examples
python-3.xplotqt-designerpyqtgraph

something automatically multiply my values per 1000 in plots


I have a GUI where I plot concentrations against position. At some points (it seems to be when my datapoints are below 0.1) the plotted values are multiplied by 1000 and ‘m’ is added to the unit (I suppose for ‘milli’, except my values are already in mmol, leading to an hugly ‘mmmol’). Like in the following figure with the following datapoints:

   0    0.01251502
  0.25  0.01188927
  0.75  0.01032489
  1.25  0.01063777
  1.75  0.00938626
  2.5  0.00782189
  3.5  0.00594463
  5    0.00344163
  7   0.0015643
  9   0.00093863
  12  0.0

Do you know how to disable this normalization ? enter image description here Unfortunately, I do not reproduce the problem with a basic plot, so I do not know where this weird normalization occurs (I use python 3.5 with pyqtgraph and a GUI built with QT designer) and did not write a clean code to show. My first hope was this is an obvious problem (like an obvious option) that you could identify without the code.


Solution

  • This is a feature of pyqtgraph.PlotItem.setLabel(). If you do not want it to do this, include the units as part of the string text instead of using the units keyword in setLabel.