Commit 74de78b3 authored by Ivo Peterek's avatar Ivo Peterek

FIX: scatter/line plot button error when no data in plot #8

parent 95b10b0b
......@@ -9,7 +9,7 @@ from matplotlib.figure import Figure
import matplotlib.pyplot as plt
from scipy import signal
from sklearn.cluster import DBSCAN
from sklearn.cluster import DBSCAN, OPTICS
import numpy as np
import matplotlib.pylab as pl
import copy as cp
......@@ -284,17 +284,19 @@ class Window(QtWidgets.QDialog):
return 0
def dotSizeChanged(self):
self.plot()
if self.samples_data:
self.plot()
def changeType(self):
self.plotType = not self.plotType
if self.plotType:
self.typeButton.setText('Line plot')
self.dotSizeSpinBox.setEnabled(True)
else:
self.typeButton.setText('Scatter plot')
self.dotSizeSpinBox.setEnabled(False)
self.plot()
if self.samples_data:
self.plotType = not self.plotType
if self.plotType:
self.typeButton.setText('Line plot')
self.dotSizeSpinBox.setEnabled(True)
else:
self.typeButton.setText('Scatter plot')
self.dotSizeSpinBox.setEnabled(False)
self.plot()
def clearCanvas(self):
self.samples_data = []
......@@ -394,6 +396,7 @@ class Window(QtWidgets.QDialog):
min_region_size = 10
clustering = DBSCAN(eps=0.9*np.sqrt(var), min_samples=min_region_size, metric=similarity).fit(samples)
#clustering = OPTICS(min_cluster_size=min_region_size, metric=similarity).fit(samples)
noisy_samples = False
unique_labels = set(clustering.labels_)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment