Commit 9bd91406 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Added new parameters to Tie_Point_Grid.plot_shift_distribution(). Added...


Added new parameters to Tie_Point_Grid.plot_shift_distribution(). Added documentation to COREG_LOCAL.view_CoRegPoints(). Bumped version and updated HISTORY.rst.
Signed-off-by: Daniel Scheffler's avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent 42c23d81
Pipeline #28390 passed with stages
in 4 minutes and 40 seconds
......@@ -2,6 +2,14 @@
History
=======
1.6.2 (2021-09-29)
------------------
* Fixed 'too many values to unpack' exception in COREG_LOCAL.view_CoRegPoints().
* Added new parameters to Tie_Point_Grid.plot_shift_distribution().
* Added documentation to COREG_LOCAL.view_CoRegPoints().
1.6.1 (2021-09-29)
------------------
......
......@@ -523,13 +523,13 @@ class COREG_LOCAL(object):
:param figsize_multiplier: if given, the figure size is multiplied with this value
:param title: plot title
:param vector_scale: scale factor for shift vector length (default: 1 -> no scaling)
:param savefigPath:
:param savefigDPI:
:param showFig: whether to show or to hide the figure
:param vmin:
:param vmax:
:param return_map:
:return:
:param savefigPath: path where to save the figure
:param savefigDPI: DPI resolution of the output figure when saved to disk (default: 96)
:param showFig: whether to show or to hide the figure (default: True)
:param vmin: minimum value of 'attribute2plot' to be included in the figure
:param vmax: maximum value of 'attribute2plot' to be included in the figure
:param return_map: whether to return the figure and axis objects (default: False)
:return: tuple of figure and axis objects or None in case return_map is set to False
"""
from matplotlib import pyplot as plt # noqa
from matplotlib.offsetbox import AnchoredText
......
......@@ -500,18 +500,26 @@ class Tie_Point_Grid(object):
xlim: list = None,
ylim: list = None,
fontsize: int = 12,
title: str = 'shift distribution'
title: str = 'shift distribution',
savefigPath: str = '',
savefigDPI: int = 96,
showFig: bool = True,
return_fig: bool = False
) -> tuple:
"""Create a 2D scatterplot containing the distribution of calculated X/Y-shifts.
:param include_outliers: whether to include tie points that have been marked as false-positives
:param unit: 'm' for meters or 'px' for pixels (default: 'm')
:param interactive: interactive mode uses plotly for visualization
:param interactive: whether to use interactive mode (uses plotly for visualization)
:param figsize: (xdim, ydim)
:param xlim: [xmin, xmax]
:param ylim: [ymin, ymax]
:param fontsize: size of all used fonts
:param title: the title to be plotted above the figure
:param savefigPath: path where to save the figure
:param savefigDPI: DPI resolution of the output figure when saved to disk
:param showFig: whether to show or to hide the figure
:param return_fig: whether to return the figure and axis objects
"""
from matplotlib import pyplot as plt
......@@ -598,9 +606,19 @@ class Tie_Point_Grid(object):
leg = plt.legend(reversed(handles), reversed(labels), fontsize=fontsize, loc='upper right', scatterpoints=3)
leg.get_frame().set_edgecolor('black')
plt.show()
# remove white space around the figure
plt.subplots_adjust(top=.94, bottom=.06, right=.96, left=.09)
return fig, ax
if savefigPath:
fig.savefig(savefigPath, dpi=savefigDPI, pad_inches=0.3, bbox_inches='tight')
if return_fig:
return fig, ax
if showFig and not self.q:
plt.show(block=True)
else:
plt.close(fig)
def dump_CoRegPoints_table(self, path_out=None):
if self.CoRegPoints_table.empty:
......
......@@ -24,5 +24,5 @@
# limitations under the License.
__version__ = '1.6.1'
__versionalias__ = '2021-09-29_01'
__version__ = '1.6.2'
__versionalias__ = '2021-09-29_02'
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