11.. _Tutorial :
22.. highlight :: python
33 :linenothreshold: 2
4- :dedent: 4
54
65========
76Tutorial
@@ -12,6 +11,7 @@ Load libraries
1211
1312.. code-block :: ipython3
1413 :linenos:
14+ :dedent: 1
1515
1616 import os
1717
@@ -42,6 +42,7 @@ for more details.
4242
4343.. code-block :: ipython3
4444 :linenos:
45+ :dedent: 1
4546
4647 from scipy.stats import norm # Used in generation of populations.
4748
@@ -96,6 +97,7 @@ Supply the DataFrame; supply the two groups you want to compare in the
9697
9798.. code-block :: ipython3
9899 :linenos:
100+ :dedent: 1
99101
100102 fig1, results1 = dabest.plot(df, idx=('Control','Group 1'))
101103
@@ -120,6 +122,7 @@ confidence intervals (95% by default) and relevant *P* values.
120122
121123.. code-block :: ipython3
122124 :linenos:
125+ :dedent: 1
123126
124127 results1 # prints out the DataFrame returned by `dabest.plot()`.
125128
@@ -204,6 +207,7 @@ You can color the dots with any column in the DataFrame, using the
204207
205208.. code-block :: ipython3
206209 :linenos:
210+ :dedent: 1
207211
208212 f2, results2 = dabest.plot(df, idx=('Control','Group 1'),
209213 color_col='Gender')
@@ -227,6 +231,7 @@ of repeated observations.
227231
228232.. code-block :: ipython3
229233 :linenos:
234+ :dedent: 1
230235
231236 f3, results3 = dabest.plot(df, idx=('Control','Group 1'),
232237 color_col='Gender',
@@ -243,6 +248,7 @@ be paired, as indicated by the DataFrame produced.
243248
244249.. code-block :: ipython3
245250 :linenos:
251+ :dedent: 1
246252
247253 f4, results4 = dabest.plot(df, idx=('Control','Group 1'),
248254 color_col='Gender',
@@ -314,6 +320,7 @@ be computed.
314320
315321.. code-block :: ipython3
316322 :linenos:
323+ :dedent: 1
317324
318325 f5, results5 = dabest.plot(df, idx=(('Control','Group 1'),
319326 ('Group 2','Group 3'),
@@ -401,6 +408,7 @@ controlled with the ``float_contrast`` option.
401408
402409.. code-block :: ipython3
403410 :linenos:
411+ :dedent: 1
404412
405413 f6, results6 = dabest.plot(df, idx=(('Control','Group 1'),
406414 ('Group 2','Group 3'),
@@ -414,6 +422,7 @@ You can also produce a paired multi-group plot, by setting `paired=True`.
414422
415423.. code-block :: ipython3
416424 :linenos:
425+ :dedent: 1
417426
418427 f6_paired, results6_paired = dabest.plot(df, idx=(('Control','Group 1'),
419428 ('Group 2','Group 3'),
@@ -442,6 +451,7 @@ be computed against the first control group.
442451
443452.. code-block :: ipython3
444453 :linenos:
454+ :dedent: 1
445455
446456 f7, results7 = dabest.plot(df, idx=('Control', 'Group 2', 'Group 4'),
447457 color_col='Gender')
@@ -518,6 +528,7 @@ the function.
518528
519529.. code-block :: ipython3
520530 :linenos:
531+ :dedent: 1
521532
522533 f8, results8 = dabest.plot(df, idx=('Control', 'Group 2', 'Group 4'),
523534 color_col='Gender',
@@ -535,6 +546,7 @@ Below we run through ways of customizing various aesthetic features.
535546
536547.. code-block :: ipython3
537548 :linenos:
549+ :dedent: 1
538550
539551 # Changing the contrast y-limits.
540552
@@ -549,6 +561,7 @@ Below we run through ways of customizing various aesthetic features.
549561
550562.. code-block :: ipython3
551563 :linenos:
564+ :dedent: 1
552565
553566 # Changing the swarmplot y-limits.
554567
@@ -563,6 +576,7 @@ Below we run through ways of customizing various aesthetic features.
563576
564577.. code-block :: ipython3
565578 :linenos:
579+ :dedent: 1
566580
567581 # Changing the figure size.
568582 # The default figure size has been tweaked for
@@ -581,6 +595,7 @@ Below we run through ways of customizing various aesthetic features.
581595
582596.. code-block :: ipython3
583597 :linenos:
598+ :dedent: 1
584599
585600 # Changing the size and alpha (transparency) of the dots in the swarmplot.
586601 # This is done through swarmplot_kwargs, which accepts a dictionary.
@@ -599,6 +614,7 @@ Below we run through ways of customizing various aesthetic features.
599614
600615.. code-block :: ipython3
601616 :linenos:
617+ :dedent: 1
602618
603619 # Custom y-axis labels.
604620 f13, results13 = dabest.plot(df, idx=('Control','Group 1','Group 2'),
@@ -615,6 +631,7 @@ Below we run through ways of customizing various aesthetic features.
615631
616632.. code-block :: ipython3
617633 :linenos:
634+ :dedent: 1
618635
619636 # Any of matplotlib's named colors will work.
620637 # See https://matplotlib.org/examples/color/named_colors.html
@@ -634,6 +651,7 @@ Below we run through ways of customizing various aesthetic features.
634651
635652.. code-block :: ipython3
636653 :linenos:
654+ :dedent: 1
637655
638656 # You can also pass colors in the RGB tuple form (r, g, b),
639657 # or in hexadecimal form (if you're more familiar with HTML color codes).
@@ -652,6 +670,7 @@ Below we run through ways of customizing various aesthetic features.
652670
653671.. code-block :: ipython3
654672 :linenos:
673+ :dedent: 1
655674
656675 # Passing a dict as a custom palette.
657676 f16, results16 = dabest.plot(df, idx=('Control','Group 1','Group 2'),
@@ -667,6 +686,7 @@ Below we run through ways of customizing various aesthetic features.
667686
668687.. code-block :: ipython3
669688 :linenos:
689+ :dedent: 1
670690
671691 # Tweaking the tick length and padding between tick and label.
672692
@@ -693,6 +713,7 @@ More details on wide vs long or 'melted' data can be found in this `Wikipedia ar
693713
694714.. code-block :: ipython3
695715 :linenos:
716+ :dedent: 1
696717
697718 x='group'
698719 y='my_metric'
@@ -769,6 +790,7 @@ numerical values for plotting) columns.
769790
770791.. code-block :: ipython3
771792 :linenos:
793+ :dedent: 1
772794
773795 f17, results17 = dabest.plot(df_melt,
774796 x='group',
0 commit comments