Conversation
…es column with floats
…ion_method and calculates a median histogram to be used as overlay Also add: - histogram_interpolation - overlay_interpolation - overlay_opacity - overlay_visible - calculate_statistic histogram - array_to_pcolormesh_rgba
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #18 +/- ##
==========================================
+ Coverage 89.65% 90.18% +0.52%
==========================================
Files 7 8 +1
Lines 667 978 +311
==========================================
+ Hits 598 882 +284
- Misses 69 96 +27 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
…default categorical overlay_colormap, set min norm value to non-zero when norm is log
…tion for scatter and histogram for both categorical and continuous colormaps categorical colormaps only accept linear normalization(log, symlog and centered are ignored in this case) if data is float with categorical colormap, linear normalization is used if colormap is continuous, all normalization methods are accepted, but limits may be adjusted
- remove 'normalization_method' parameter from array_to_pcolormesh_rgba - rename indices_in_above_threshold_patches method to indices_in_patches_above_threshold - don't draw the overlay if all values are NaN - initialize self._overlay_visible
…_color_normalization_method property
… where no computations were done
|
Hi @jo-mueller , I am adding here the possibility to display the scatter colors or an histogram overlay based o another features column (not just a categorical array with integers, but rather any float array with a continuous colormap - I renamed You can get a feeling of the changes by running the Artists notebook again, which I updated. Of course a histogram overlay completely hides the original histogram, but it may be useful if the user hide and show it quickly or change its opacity for example. When you get some time, could you please give it a try to check if we can merge this? |
|
Hi @zoccoler , sorry for the late reply. I am a bit undecided on this implementation: On the one hand I like the simplicity of this: Simply change the colormap to something continuous, pass a float to the color indices and have your plot colored. On the other hand, it loads the same property (color) with potentially multiple meanings. In the context of the clusters plotter, it would be hard to use colored scatter points in conjunction with the clustering. As an alternative suggestion: Would you think that it could make sense to forward the coloring done with Let me know what you think! |
src/biaplotter/artists.py
Outdated
| # Create a ScalarMappable instance using chosen colormap and normalization | ||
| sm = ScalarMappable(norm=norm, cmap=self.overlay_colormap.cmap) | ||
| # Convert normalized data to RGBA | ||
| rgba_colors = sm.to_rgba(indices) |
There was a problem hiding this comment.
This is problematic, I think. By applying a color normalization here, there is no longer a clear mapping between color_indices and the actually drawn color in the plot.
Usually, what should work is
color = active_artist.overlay_colormap(color_indices)and the colors I get should be exactly the same as in the plot. However, the colors in the plot pass through an additional normalization step. To recover the colors from the plot (like needed for the clusters plotter), I need to do this:
color_indices = active_artist.color_indices
norm = active_artist._get_normalization(color_indices)
colors = active_artist._get_rgba_colors(color_indices, norm)Maybe there could be an additional convenience method to wrap the normalization and to_rgba step? Or the normalization step could go into the __call__ method of the new BiaColormap?
|
Hi @zoccoler , besides the above points, another problem for me is that with the
In the scope of the clusters-plotter, this distinction is important though. Consider this workflow:
|
That is why I had placed this 😅 Does it help to solve that problem? |
|
That should help :) |
This reverts commit f3c0569.
refactor `color_indices` setter into separate subfunctions
…atistic_histogram and format code
…threshold to Histogram2D in documentation file
|
Hi @jo-mueller , This is now merged. I will make the new release early next week because I have to prepare a fix release for napari-phasors due to the breaking changes introduced here. Please refer to the main branch for now while working in the clusters-plotter. |
This adds the possibility to assign an array with floats (like representing some feature) as an overlay to the histogram and to the scatter plot.