summaryrefslogtreecommitdiff
path: root/examples/plotInteractiveImageROI.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/plotInteractiveImageROI.py')
-rw-r--r--examples/plotInteractiveImageROI.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/plotInteractiveImageROI.py b/examples/plotInteractiveImageROI.py
index 8a4019f..c10bbf3 100644
--- a/examples/plotInteractiveImageROI.py
+++ b/examples/plotInteractiveImageROI.py
@@ -2,7 +2,7 @@
# coding: utf-8
# /*##########################################################################
#
-# Copyright (c) 2018-2019 European Synchrotron Radiation Facility
+# Copyright (c) 2018-2020 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -61,6 +61,7 @@ if "--opengl" in sys.argv:
# Create the plot widget and add an image
plot = Plot2D(backend=backend)
plot.getDefaultColormap().setName('viridis')
+plot.setKeepDataAspectRatio(True)
plot.addImage(dummy_image())
# Create the object controlling the ROIs and set it up
@@ -74,14 +75,17 @@ def updateAddedRegionOfInterest(roi):
if roi.getName() == '':
roi.setName('ROI %d' % len(roiManager.getRois()))
if isinstance(roi, LineMixIn):
- roi.setLineWidth(2)
+ roi.setLineWidth(1)
roi.setLineStyle('--')
if isinstance(roi, SymbolMixIn):
roi.setSymbolSize(5)
+ roi.setSelectable(True)
+ roi.setEditable(True)
roiManager.sigRoiAdded.connect(updateAddedRegionOfInterest)
+
# Add a rectangular region of interest
roi = RectangleROI()
roi.setGeometry(origin=(50, 50), size=(200, 200))