Skip to content
Snippets Groups Projects
Unverified Commit 5d66f644 authored by Mara Lampert's avatar Mara Lampert Committed by GitHub
Browse files

change figure names

parent cd754c37
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id:15fee2ed-980b-4d1a-a31a-1e261c31d9aa tags:
# Figure 5.06: Small label exclusion
%% Cell type:code id:39cd2c59-0e87-4083-8158-c8b4307a7126 tags:
``` python
import pandas as pd
import seaborn as sns
import matplotlib as mpl
import matplotlib.pyplot as plt
```
%% Cell type:code id:3dcc5326-9284-4da5-90eb-69ae42bb4ad6 tags:
``` python
all_labels_training = pd.read_csv("Measurements_with_frame_clustering_with_GMM.csv")
```
%% Cell type:code id:0abc6b00-0cec-4a92-a30c-d97ae5094af2 tags:
``` python
area = all_labels_training['area_norm']
```
%% Cell type:code id:aa69fed7-a1f4-48df-9f8e-31a5207dbfb8 tags:
``` python
threshold = 50
```
%% Cell type:code id:1284e287-6ac8-4cf6-93cf-7fa8eeed6fd0 tags:
``` python
fig, axis = plt.subplots()
axis.hist(area, label='Area training data', bins = 500, alpha=0.7, color = '#79bafa', edgecolor='black', range = (0,6000))
axis.set_xlim(0,500)
axis.axvline(threshold, color = '#ae0001', label = 'threshold')
axis.set_xlabel('area')
axis.set_ylabel('count')
axis.legend()
axis.set_title('Distribution of labels before small label exclusion')
```
%% Output
Text(0.5, 1.0, 'Distribution of labels before small label exclusion')
%% Cell type:code id:72c83cf2-fbcb-4242-ba5a-d0f35e38ab66 tags:
``` python
area_threshold = 50
thresholded_groups = [0 if area < 50 else 1 for area in regprops["area_norm"]]
thresholded_groups[:5]
```
%% Output
[0, 0, 0, 0, 0]
%% Cell type:code id:03d44312-b311-4165-aceb-7d5b7b454c17 tags:
``` python
regprops["thresholded_groups"] = thresholded_groups
```
%% Cell type:code id:fe500edc-0b2e-4cd9-9cd0-5a5ee0a47fe2 tags:
``` python
from napari_clusters_plotter._utilities import get_nice_colormap
colormap_dict = {i: color for i,color in enumerate(get_nice_colormap())}
```
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment