Skip to content

Commit 47a2ffe

Browse files
committed
Apply FixFormatter with FixLocator in matplotlib
Bug fixes and test plots regeneration
1 parent 336522c commit 47a2ffe

38 files changed

Lines changed: 6 additions & 0 deletions

dabest/plotter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def EffectSizeDataFramePlotter(EffectSizeDataFrame, **plot_kwargs):
4646

4747
import numpy as np
4848
import seaborn as sns
49+
import matplotlib
4950
import matplotlib.pyplot as plt
5051
import pandas as pd
5152
import warnings
@@ -559,6 +560,8 @@ def EffectSizeDataFramePlotter(EffectSizeDataFrame, **plot_kwargs):
559560
# Add the counts to the rawdata axes xticks.
560561
counts = plot_data.groupby(xvar).count()[yvar]
561562
ticks_with_counts = []
563+
ticks_loc = rawdata_axes.get_xticks()
564+
rawdata_axes.xaxis.set_major_locator(matplotlib.ticker.FixedLocator(ticks_loc))
562565
for xticklab in rawdata_axes.xaxis.get_ticklabels():
563566
t = xticklab.get_text()
564567
if t.rfind("\n") != -1:

nbs/API/plotter.ipynb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
"\n",
9999
" import numpy as np\n",
100100
" import seaborn as sns\n",
101+
" import matplotlib\n",
101102
" import matplotlib.pyplot as plt\n",
102103
" import pandas as pd\n",
103104
" import warnings\n",
@@ -611,6 +612,8 @@
611612
" # Add the counts to the rawdata axes xticks.\n",
612613
" counts = plot_data.groupby(xvar).count()[yvar]\n",
613614
" ticks_with_counts = []\n",
615+
" ticks_loc = rawdata_axes.get_xticks()\n",
616+
" rawdata_axes.xaxis.set_major_locator(matplotlib.ticker.FixedLocator(ticks_loc))\n",
614617
" for xticklab in rawdata_axes.xaxis.get_ticklabels():\n",
615618
" t = xticklab.get_text()\n",
616619
" if t.rfind(\"\\n\") != -1:\n",
625 Bytes
Loading
608 Bytes
Loading
481 Bytes
Loading
-41 Bytes
Loading
-67 Bytes
Loading
-11 Bytes
Loading
-11 Bytes
Loading
-14 Bytes
Loading

0 commit comments

Comments
 (0)