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

StackedReader(image[, ax, extent, plot, …])

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 reader

  • parent (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

decrease_current_col()

Take the previous column as the current column

digitize()

Digitize the data interactively

enable_or_disable_navigation_buttons()

Enable or disable btn_prev and btn_next

get_binary_for_col(col)

Get the binary array for a specific column

increase_current_col()

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_lbl_col()

Reset the lbl_col to display the current column

resize_axes(grouper, bounds)

Reimplemented to do nothing

select_and_add_current_column()

Select the features for a column and create it as a new one

select_current_column()

Select the features of the current column

update_col()

Update the current column based on the selection.

update_plotted_full_df()

Update the plotted full_df if it is shown

Attributes

btn_add

A QPushButton to add a new variable to the current ones

btn_edit

A QPushButton to select the features in the image for the current

btn_next

A QPushButton to select the next variable during the digitization

btn_prev

A QPushButton to select the previous variable during the digitization

digitize_child

The QTreeWidgetItem that holds the digitization widgets

lbl_col

A QLabel to display the current column

start_of_current_col

The first x-pixel of the current column

strat_plot_identifier

str(object=’’) -> str

add_col()[source]

Create a column out of the current selection

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())

decrease_current_col()[source]

Take the previous column as the current column

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_navigation_buttons()[source]

Enable or disable btn_prev and btn_next

Depending on the current column, we disable the navigation buttons btn_prev and btn_next

get_binary_for_col(col)[source]

Get the binary array for a specific column

increase_current_col()[source]

Take the next column as the current column

lbl_col = None

A QLabel to display the current column

plot_full_df(ax=None)[source]

Plot the lines for the digitized diagram

plot_potential_samples(excluded=False, ax=None, plot_kws={}, *args, **kwargs)[source]

Plot the ranges for potential samples

reset_lbl_col()[source]

Reset the lbl_col to display the current column

resize_axes(grouper, bounds)[source]

Reimplemented to do nothing

select_and_add_current_column()[source]

Select the features for a column and create it as a new one

select_current_column()[source]

Select the features of the current column

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.

update_plotted_full_df()[source]

Update the plotted full_df if it is shown

See also

plot_full_df()