diff --git a/shapeout2/gui/analysis/ana_plot.py b/shapeout2/gui/analysis/ana_plot.py index dd34a78..da6b29f 100644 --- a/shapeout2/gui/analysis/ana_plot.py +++ b/shapeout2/gui/analysis/ana_plot.py @@ -180,7 +180,7 @@ def __setstate__(self, state): color_index = COLORMAPS.index(sca["colormap"]) self.comboBox_colormap.setCurrentIndex(color_index) self.checkBox_event_count.setChecked(sca["show event count"]) - self.spinBox_alpha.setValue(sca["marker alpha"]*100) + self.spinBox_alpha.setValue(int(sca["marker alpha"]*100)) if sca["marker hue"] == "feature": self._set_range_feat_state(sca["hue feature"], sca["hue min"], sca["hue max"]) diff --git a/shapeout2/gui/widgets/colorbar_widget.py b/shapeout2/gui/widgets/colorbar_widget.py index aae5dfa..6c375fa 100644 --- a/shapeout2/gui/widgets/colorbar_widget.py +++ b/shapeout2/gui/widgets/colorbar_widget.py @@ -61,20 +61,23 @@ def __init__(self, cmap, width, height, vmin=0.0, vmax=1.0, label=""): maxwidth = 0.0 for tick, tick_label in zip(ticks, tick_labels): y_ = (1.0 - (tick - smn)/spp) * h - p.drawLine(w, y_, w+5.0, y_) + p.drawLine(w, int(y_), int(w+5.0), int(y_)) br = p.boundingRect( 0, 0, 0, 0, pg.QtCore.Qt.AlignRight, tick_label) if br.x() < mintx: mintx = br.x() if br.width() > maxwidth: maxwidth = br.width() - p.drawText(br.x() + 10.0 + w + br.width(), - y_ + br.height() / 4.0, tick_label) + p.drawText(int(br.x() + 10.0 + w + br.width()), + int(y_ + br.height() / 4.0), + tick_label) # draw label br = p.boundingRect(0, 0, 0, 0, pg.QtCore.Qt.AlignBottom, label) p.rotate(90) - p.drawText(h/2 - br.width()/2, -w-maxwidth-15, label) + p.drawText(int(h/2 - br.width()/2), + int(-w-maxwidth-15), + label) # done p.end()