mfitzp / pathomx

Workflow based scientific analysis built on Python
https://www.mfitzp.com/tools/pathomx/
GNU General Public License v3.0
91 stars 30 forks source link

Graph markers, colours for classifications and scales #5

Closed mfitzp closed 10 years ago

mfitzp commented 10 years ago

Some system for assigning graph markers and colours for both classes (groups in data) and scales (ranges) is needed. It would probably make sense to define this centrally attached to the workflow, so that you can set them once and all figures will obey the same theme.

I'm sort of envisaging some kind of filter system on class markers. So, for example if you have 4 classes M1, M2, DC, Mo. You could define classes assigning by filter "m" diamonds to M1, M2, Mo; "dc" blue circles; "1" green"; "2" red; "o" purple. The end result being the M1 is a green diamond.

This needs a nice logical interface to work together with the appropriate lookup functions for use in the views.

mfitzp commented 10 years ago

The initial implementation of this is now in place in commit 196e0c3feb7f457a8b8f7b7427e4ce6c25294010

This initial implementation is non-interactive, but has the backend to support defined colour assignments in future. Presently this watches for classes and assigns a unique style to each. These are persisted in the current session and will ensure figures all remain consistent across the different plots. An API is provided for plots to access the attributes and use as neccessary, the full set being available as ls.kwargs, or ls.line_kwargs, or ls.marker_kwargs for the line and marker specific kwargs.

The next step in implementation is a UI to allow definition of class-name matching to assign specific colours and marker styles.

mfitzp commented 10 years ago

This is now done in master 0f9d1e772c. Provides a full interactive editor for setting matplotlib marker, line and color styles together with various matching options (exact, starts with, ends with, in, and regexp) for matching classes to styles. Styles are applied cumulatively so if >1 rule matches a compound style will result.

Styles are saved and loaded with workflows allowing re-use. Last 'to-do' (later, as separate issue) is allowing loading and saving of style definitions separately to workflows - this depends on other style config implementation first.