straditize.widgets.stacked_area_reader module¶
DataReader for stacked area plots
Disclaimer
Copyright (C) 2018-2019 Philipp S. Sommer
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Classes
|
A DataReader for stacked area plots |
-
class
straditize.widgets.stacked_area_reader.
StackedReader
(image, ax=None, extent=None, plot=True, children=[], parent=None, magni=None, plot_background=False, binary=None)[source]¶ Bases:
straditize.binary.DataReader
,straditize.widgets.StraditizerControlBase
A DataReader for stacked area plots
This reader only works within the straditizer GUI because the digitization (see
digitize()
) is interactive. The user has to manually distinguish the stacked variables.- Parameters
image (PIL.Image.Image) – The image of the diagram
ax (matplotlib.axes.Axes) – The matplotlib axes to plot on
extent (list) – List of four number specifying the extent of the image in it’s source. This extent will be used for the call of
matplotlib.pyplot.imshow()
children (list of
DataReader
) – Child readers for other columns in case the newly created instance is the parent readerparent (
DataReader
) – The parent reader.magni (straditize.magnifier.Magnifier) – The magnifier for the given ax
plot_background (bool) – If True (and plot is True), a white, opaque are is plotted below the
plot_im
binary (None) – The binary version of the given image. If not provided, the
to_binary_pil()
method is used with the given image
Methods
add_col
()Create a column out of the current selection
Take the previous column as the current column
digitize
()Digitize the data interactively
Enable or disable
btn_prev
andbtn_next
get_binary_for_col
(col)Get the binary array for a specific column
Take the next column as the current column
plot_full_df
([ax])Plot the lines for the digitized diagram
plot_potential_samples
([excluded, ax, plot_kws])Plot the ranges for potential samples
Reset the
lbl_col
to display the current columnresize_axes
(grouper, bounds)Reimplemented to do nothing
Select the features for a column and create it as a new one
Select the features of the current column
Update the current column based on the selection.
Update the plotted full_df if it is shown
Attributes
A QPushButton to add a new variable to the current ones
A QPushButton to select the features in the image for the current
A QPushButton to select the next variable during the digitization
A QPushButton to select the previous variable during the digitization
The QTreeWidgetItem that holds the digitization widgets
A QLabel to display the current column
The first x-pixel of the current column
str(object=’’) -> str
-
btn_add
= None¶ A QPushButton to add a new variable to the current ones (see
select_and_add_current_column()
)
-
btn_edit
= None¶ A QPushButton to select the features in the image for the current variable (see
select_current_column()
)
-
btn_next
= None¶ A QPushButton to select the next variable during the digitization (see
increase_current_col()
)
-
btn_prev
= None¶ A QPushButton to select the previous variable during the digitization (see
decrease_current_col()
)
-
digitize
()[source]¶ Digitize the data interactively
This method creates a new child item for the digitize button in the straditizer control to manually distinguish the variables in the stacked diagram.
-
digitize_child
= None¶ The QTreeWidgetItem that holds the digitization widgets
Enable or disable
btn_prev
andbtn_next
Depending on the current column, we disable the navigation buttons
btn_prev
andbtn_next
-
lbl_col
= None¶ A QLabel to display the current column
-
plot_potential_samples
(excluded=False, ax=None, plot_kws={}, *args, **kwargs)[source]¶ Plot the ranges for potential samples
-
select_and_add_current_column
()[source]¶ Select the features for a column and create it as a new one
-
property
start_of_current_col
¶ The first x-pixel of the current column
-
strat_plot_identifier
= 'stacked'¶
-
update_col
()[source]¶ Update the current column based on the selection.
This method updates the end of the current column and adds or removes the changes from the columns to the right.