Updated pie-chart method for Mattér

This commit is contained in:
Phuntsok Drak-pa 2019-09-09 19:16:03 +02:00
parent c7f3ab81de
commit 227b091550
3 changed files with 26 additions and 15 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -7,6 +7,7 @@
#+LATEX_HEADER: \usepackage{allrunes} #+LATEX_HEADER: \usepackage{allrunes}
#+MACRO: rune-manual @@latex:\textara{$1}@@ @@html:$2@@ #+MACRO: rune-manual @@latex:\textara{$1}@@ @@html:$2@@
#+MACRO: rune (eval (conlanging/matter-org-export-runes "$1")) #+MACRO: rune (eval (conlanging/matter-org-export-runes "$1"))
#+OPTIONS: auto-id:t
* Avant-propos * Avant-propos
:PROPERTIES: :PROPERTIES:
@ -107,24 +108,22 @@
bouddhiste et 2% de la population suit des religions diverses (Hindouisme, bouddhiste et 2% de la population suit des religions diverses (Hindouisme,
Chamanisme,…). Chamanisme,…).
#+begin_src python :session :results file :exports results #+NAME: src:religion-piechart
import matplotlib.pyplot as plt #+BEGIN_SRC R :exports results :results graphics :file img/eittlanda/religious-pop.png :bg transparent :var rels=table-religions-einlant
labels = ['Paganisme', 'Athéisme', 'Monothéismes divers', 'Bouddhisme', slices <- rels[,1]
'Divers'] lbls <- rels[,2]
sizes = [68, 15, 9, 6, 2] pct <- round(slices/sum(slices)*100)
colors = ['yellowgreen', 'gold', 'lightskyblue', 'lightcoral', 'red'] lbls <- paste(lbls, pct)
patches, texts = plt.pie(sizes, colors=colors, shadow=False, startangle=90) lbls <- paste(lbls, "%", sep = "")
plt.legend(patches, labels, loc="best") par(mar=c(0,0,0.7,3))
plt.axis('equal') pie(slices, labels = lbls, col = rainbow(length(lbls)),
plt.tight_layout() main = "Religions dÉïnlante")
plt.savefig('img/matter_religious-pop.png', transparent=True) #+END_SRC
'img/matter_religious-pop.png' # return filename to org-mode
#+end_src
#+ATTR_LATEX: :width 8cm #+ATTR_LATEX: :width 8cm
#+CAPTION: Population religieuse dÉïnlante #+CAPTION: Population religieuse dÉïnlante
#+LABEL: fig:religion-piechart #+LABEL: fig:religion-piechart
#+RESULTS: #+RESULTS: src:religion-piechart
[[file:img/matter_religious-pop.png]] [[file:img/eittlanda/religious-pop.png]]
{{{newline}}} {{{newline}}}
** Histoire ** Histoire
@ -2703,6 +2702,18 @@
{{{newpage}}} {{{newpage}}}
* Data not to be exported :noexport:
:PROPERTIES:
:CUSTOM_ID: h-536d66fd-738b-4daf-ac65-3361a54506fe
:END:
#+NAME: table-religions-einlant
| 68 | Paganisme |
| 15 | Athéisme |
| 9 | Monothéisme divers |
| 6 | Bouddhisme |
| 2 | Divers |
* Footnotes * Footnotes
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: h-defe47b2-686b-4d1c-ba9b-c84e6c482478 :CUSTOM_ID: h-defe47b2-686b-4d1c-ba9b-c84e6c482478