From 9998a37e7a84b278e78af77d7e6bbb3386e1a09b Mon Sep 17 00:00:00 2001 From: "Daniel.Frisinghelli" <daniel.frisinghelli@eurac.edu> Date: Fri, 12 Feb 2021 16:54:48 +0100 Subject: [PATCH] Changed default format from png to pdf. --- pysegcnn/plot/class_distribution.py | 6 +++--- pysegcnn/plot/composites.py | 6 +++--- pysegcnn/plot/plot_config.py | 9 ++++----- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/pysegcnn/plot/class_distribution.py b/pysegcnn/plot/class_distribution.py index 1d9da16..3c93fc3 100644 --- a/pysegcnn/plot/class_distribution.py +++ b/pysegcnn/plot/class_distribution.py @@ -22,7 +22,7 @@ from pysegcnn.core.trainer import DatasetConfig from pysegcnn.core.graphics import plot_class_distribution from pysegcnn.core.logging import log_conf from pysegcnn.plot.plot_config import (PLOT_PATH, BANDS, FIGSIZE, ALPHA, - DATASETS, DPI) + DATASETS) if __name__ == '__main__': @@ -42,5 +42,5 @@ if __name__ == '__main__': fig = plot_class_distribution(ds, FIGSIZE, ALPHA) # save figure - filename = PLOT_PATH.joinpath('{}_sdist.png'.format(name)) - fig.savefig(filename, dpi=DPI, bbox_inches='tight') + filename = PLOT_PATH.joinpath('{}_sdist.pdf'.format(name)) + fig.savefig(filename, bbox_inches='tight') diff --git a/pysegcnn/plot/composites.py b/pysegcnn/plot/composites.py index 6a937bd..c936659 100644 --- a/pysegcnn/plot/composites.py +++ b/pysegcnn/plot/composites.py @@ -23,7 +23,7 @@ from pysegcnn.core.trainer import DatasetConfig from pysegcnn.core.graphics import plot_sample from pysegcnn.core.logging import log_conf from pysegcnn.plot.plot_config import (PLOT_PATH, BANDS, FIGSIZE, ALPHA, - DATASETS, PLOT_BANDS, DPI) + DATASETS, PLOT_BANDS) # module level logger LOGGER = logging.getLogger(__name__) @@ -57,5 +57,5 @@ if __name__ == '__main__': alpha=ALPHA, figsize=FIGSIZE) # save the figure - fig.savefig(PLOT_PATH.joinpath('.'.join([scene_id, 'png'])), - dpi=DPI, bbox_inches='tight') + fig.savefig(PLOT_PATH.joinpath('.'.join([scene_id, 'pdf'])), + bbox_inches='tight') diff --git a/pysegcnn/plot/plot_config.py b/pysegcnn/plot/plot_config.py index b6a0c37..2562003 100644 --- a/pysegcnn/plot/plot_config.py +++ b/pysegcnn/plot/plot_config.py @@ -29,8 +29,8 @@ if not PLOT_PATH.exists(): # path to the datasets on the current machine # DRIVE_PATH = pathlib.Path('C:/Eurac/Projects/CCISNOW/Datasets/') -# DRIVE_PATH = pathlib.Path('F:/Studium/SS 2020/Datasets/') -DRIVE_PATH = pathlib.Path('/mnt/CEPH_PROJECTS/cci_snow/dfrisinghelli/Datasets') # nopep8 +DRIVE_PATH = pathlib.Path('F:/Studium/SS 2020/Datasets/') +# DRIVE_PATH = pathlib.Path('/mnt/CEPH_PROJECTS/cci_snow/dfrisinghelli/Datasets') # nopep8 # DRIVE_PATH = pathlib.Path('/home/dfrisinghelli/Datasets') # name and paths to the datasets @@ -42,15 +42,14 @@ DATASETS = {'Sparcs': {'root_dir': DRIVE_PATH.joinpath('Sparcs'), 'merge_labels': {'Cirrus': 'Cloud', 'Not_used': 'No_data'}, 'gt_pattern': '(.*)Labels\\.tif'} - } + } # spectral bands to plot distribution BANDS = ['blue', 'green', 'red', 'nir', 'swir1', 'swir2'] # plot parameters -FIGSIZE = (16, 9) +FIGSIZE = (10, 10) ALPHA = 0.5 -DPI = 300 # natural with atmospheric removal PLOT_BANDS = ['swir2', 'nir', 'green'] -- GitLab