<jupyter_start><jupyter_text>Part 8 of Recipes: Stacked HistogramsThis page is primarily based on the following page at the Circos documentation site:- [8. Stacked Histograms](????????????)That page is found as part number 4 of the ??? part ['Recipes' section](http://circos.ca/documentation/tutorials/quick_start/) of [the larger set of Circos tutorials](http://circos.ca/documentation/tutorials/).Go back to Part 7 by clicking [here &8592;](Recipes_Part7.ipynb).----8 --- Recipes=============8. Stacked Histograms---------------------::: {menu4}[[Lesson](/documentation/tutorials/recipes/stacked_histograms/lesson){.clean}]{.active}[Images](/documentation/tutorials/recipes/stacked_histograms/images){.normal}[Configuration](/documentation/tutorials/recipes/stacked_histograms/configuration){.normal}::: stacking data setsStacked histograms are an extenstion of the histogram track. To plotstacked histograms, the only adjustment you require is to provide aseries of values for each histogram bin in your data file.For example, here is a part of a data file for a stacked histogram inwhich 5 data sets are stacked. ```ini...hs7 65000000 69999999 0.388090,0.070074,0.547485,0.842239,0.525658hs7 70000000 74999999 0.886542,0.321023,0.145677,0.897684,0.264217hs7 75000000 79999999 0.854199,0.567889,0.574767,0.656331,0.418385hs7 80000000 84999999 0.286509,0.201049,0.552485,0.876529,0.999801hs7 85000000 89999999 0.154836,0.515471,0.389453,0.440168,0.475127...``` The first value will appear at the bottom of the bin\'s stack, then thesecond, then third, and so on. formatting stacked data setsIndividual format parameters (`color`, `thickness` `fill_color`,`pattern`) for each data sets can be specified by providing a list ofcomma-separated values.For example, to make each data set filled with a different color,provide five different values for `fill_color`. ```inifill_color = red,orange,yellow,green,blue``` If you provide parameter values than data sets, they will be cycled.Assigning individual values for color and thickness can produce usefuldisplays, particularly when `color=white` and `thickness` is varied. ```inicolor      = whitefill_color = red,orange,yellow,green,bluefill_under = yesthickness  = 1,2,3,4,5```  colors and patternsYou can independently cycle bins\' color and pattern. ```inifill_color = red,grey,blackpattern    = checker,solid``` will create the following bins ```inicolor  patternred    checkergrey   solidblack  checkerred    solidgrey   checkerblack  solid...    ...```  adjusting stack orderBy default, the bins are stacked in order of appearance of their valuesin the data file. Thus, given the colors ```inifill_color = red,orange,yellow,green,blue``` the data line ```inihs1 0 4999999 0.237788,0.291066,0.845814,0.152208,0.585537``` the bins will stack in the following order-   0.237788 (red)-   0.291066 (orange)-   0.845814 (yellow)-   0.152208 (green)-   0.585537 (blue)However, when ```inisort_bin_values = yes``` is used, the bins will be stacked by decreasing value-   0.845814 (yellow)-   0.585537 (blue)-   0.291066 (orange)-   0.237788 (red)-   0.152208 (green)---- Generating the plot produced by this example codeThe following two cells will generate the plot. The first cell adjusts the current working directory.<jupyter_code>%cd ../circos-tutorials-0.67/tutorials/8/8/
%%bash
../../../../circos-0.69-6/bin/circos -conf circos.conf<jupyter_output>debuggroup summary 0.47s welcome to circos v0.69-6 31 July 2017 on Perl 5.022000
debuggroup summary 0.47s current working directory /home/jovyan/circos-tutorials-0.67/tutorials/8/8
debuggroup summary 0.47s command ../../../../circos-0.69-6/bin/circos -conf circos.conf
debuggroup summary 0.47s loading configuration from file circos.conf
debuggroup summary 0.47s found conf file circos.conf
debuggroup summary 0.68s debug will appear for these features: output,summary
debuggroup summary 0.68s bitmap output image ./circos.png
debuggroup summary 0.68s SVG output image ./circos.svg
debuggroup summary 0.68s parsing karyotype and organizing ideograms
debuggroup summary 0.81s karyotype has 24 chromosomes of total size 3,095,677,436
debuggroup summary 0.81s applying global and local scaling
debuggroup summary 0.81s allocating image, colors and brushes
debuggroup summary 3.14s drawing 3 ideograms of total size 690,472,427
debuggroup summary 3.14s drawing highlights and ideograms
debuggroup summary[...]<jupyter_text>View the plot in this page using the following cell.<jupyter_code>from IPython.display import Image
Image("circos.png")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11028446389496718, 'fraction_numerical': 0.1074398249452954, 'mean_word_length': 4.9751633986928105, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 5, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '348885', 'license': 'MIT', 'n_tokens_mistral': 1729, 'n_tokens_neox': 1372, 'n_words': 471, 'path': 'notebooks/Recipes_Part8.ipynb', 'repo_name': 'fomightez/cbr-accompmatz', 'size': '4570'}