Fixing colors to samples in plot1d
See original GitHub issueIs your feature request related to a problem? Please describe.
By default, it seems the color order of stacked+overlayed processes in plot1d
is fixed by yield. This makes side-by-side yield comparison of histograms difficult, particularly when one tries to compare individual process yield in a histogram (since if the yield order changes, the color also changes, instead of the color being fixed to a particular sample, so you can’t easily compare side-by-side).
Describe the solution you’d like
I would like to have functionality for plot1d
to create plots where both:
- processes are overlayed and stacked are ordered by yield (exists)
- specific colors are fixed to specific samples (to my knowledge does not exist)
Perhaps this could be passed as an option in plot1d
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
getdist.plots — GetDist 1.4 documentation
GetDistPlotter. Main class for making plots from one or more sets of samples. GetDistPlotSettings. Settings class (colors, sizes, font, styles etc.) ...
Read more >Fixing color in scatter plots in matplotlib - Stack Overflow
Setting vmin and vmax should do this. Here's an example: import matplotlib.pyplot as plt xyc = range(20) plt.subplot(121) ...
Read more >Fixing color in scatter plots in Matplotlib - Tutorialspoint
Plot the lists, xs and ys, using scatter() method, with the list of colors. To display the figure, use show() method. Example. import...
Read more >plot1d — coffea 0.7.20 documentation - GitHub Pages
plot1d . coffea.hist.plot1d(hist, ax=None, clear=True, overlay=None, stack=False, overflow='none', line_opts=None, fill_opts=None, error_opts=None, ...
Read more >R Assign Fixed Colors to Categorical Variable in ggplot2 Plot ...
Assign Fixed Colors to Categorical Variable in ggplot2 Plot in R (Example). This page shows how to assign pre-defined colors to qualitative variables...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
hist
should be solving this once https://github.com/scikit-hep/hist/pull/243 gets doneConcerning hist - we do, and I think what you pose as a solution is the right way to go. It’ll be a post 0.7.0 development unless you make a good reason on #396. It may mark 0.8.0 since I imagine there will be breaking changes at some level, or backwards compatibility will be a pain.
Thinking about it, making the plotting interface in coffea as thin as possible, approaching what you’re suggesting, would be a good extension of the 0.7.0 targets.
More generally, I wasn’t proposing an interface but rather a place where people can put recipes for specific useful behaviors so there’s not a parallel ecosystem of twikis and gists. By accumulating those it can help inform further development in dependent packages, and we can update/deprecate contrib items accordingly.
I think a contrib area thing makes a lot of sense from that perspective as typically these recipes involve assumptions about inputs or available packages.