fig4S1.py 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. """Some, but not all Figure 4S1 plots, use run -i fig4S1.py. Companion to fig4.py.
  2. fig1.py and fig3.py contribute some plots to 4S1 as well"""
  3. mi = pd.MultiIndex.from_product([mvigrtmsustrs, STIMTYPES],
  4. names=['msu', 'stimtype'])
  5. fig4S1b = pd.DataFrame(index=mi, columns=['meanrate'])
  6. """Exporting all the various panels in fig4S1 to .csv is complicated.
  7. Mostly they come from elsewhere:
  8. a: maxFMI.csv : fig3.py
  9. b: fig4S1b.csv : fig4S1.py
  10. c--d: fig1.csv : fig1.py
  11. e--f: maxFMI.csv, also duplicated in fig4.csv : fig4.py
  12. g--l: left: fig1.csv; middle & right: fig3.csv : fig4S1.py
  13. """
  14. # fig4S1b: scatter plot best movie vs best grating mean firing rate, during control condition,
  15. # one point per msu:
  16. figsize = DEFAULTFIGURESIZE
  17. logmin, logmax = -1, 2
  18. logticks = np.array([-1, 0, 1, 2])
  19. mvivals, grtvals, exmplis, exmplmsustrs, normlis = [], [], [], [], []
  20. keptmsui = 0 # manually init and increment instead of using enumerate()
  21. for msustr in mvigrtmsustrs:
  22. try:
  23. mvival = bestmviresp['meanrate'][msustr, 'nat', 'none', False]
  24. grtval = bestgrtresp['meanrate'][msustr, 'none', False]
  25. except KeyError:
  26. continue # msustr doesn't exist in one of bestmviresp or bestgrtresp
  27. if pd.isna(mvival) or pd.isna(grtval): # missing one or both values
  28. continue
  29. mvivals.append(mvival)
  30. grtvals.append(grtval)
  31. # grt meanrate, meanrate02 and meanrate35 columns will all be identical:
  32. fig4S1b.loc[msustr, 'mvi']['meanrate'] = mvival # save
  33. fig4S1b.loc[msustr, 'grt']['meanrate'] = grtval # save
  34. if msustr in msu2exmpli:
  35. exmplis.append(keptmsui)
  36. exmplmsustrs.append(msustr)
  37. else:
  38. normlis.append(keptmsui)
  39. keptmsui += 1 # manually increment
  40. mvivals = np.asarray(mvivals)
  41. grtvals = np.asarray(grtvals)
  42. f, a = plt.subplots(figsize=figsize)
  43. wintitle('%s movie grating scatter %s %s' % ('meanrate', 'none', False))
  44. # plot y=x line:
  45. xyline = [10**logmin, 10**logmax], [10**logmin, 10**logmax]
  46. a.plot(xyline[0], xyline[1], '--', color='gray', zorder=-1)
  47. # plot normal (non-example) points:
  48. c = desat(st82clr['none'], opto2alpha[False]) # do manual alpha mixing
  49. a.scatter(grtvals[normlis], mvivals[normlis], clip_on=False,
  50. marker='.', c='None', edgecolor=c, s=DEFSZ)
  51. # plot example points, one at a time:
  52. for exmpli, msustr in zip(exmplis, exmplmsustrs):
  53. marker = exmpli2mrk[msu2exmpli[msustr]]
  54. c = exmpli2clr[msu2exmpli[msustr]]
  55. sz = exmpli2sz[msu2exmpli[msustr]]
  56. lw = exmpli2lw[msu2exmpli[msustr]]
  57. a.scatter(grtvals[exmpli], mvivals[exmpli], marker=marker, c=c, s=sz, lw=lw)
  58. # plot mean:
  59. #a.scatter(np.mean(grtvals), np.mean(mvivals),
  60. # c='red', edgecolor='red', s=50, marker='^')
  61. a.set_xlabel('Grating FR (spk/s)')
  62. a.set_ylabel('Movie FR (spk/s)')
  63. a.set_xscale('log')
  64. a.set_yscale('log')
  65. a.set_xlim(10**logmin, 10**logmax)
  66. a.set_ylim(10**logmin, 10**logmax)
  67. a.set_xticks(10.0**logticks)
  68. a.set_yticks(a.get_xticks()) # make log scale y ticks the same as x ticks
  69. a.minorticks_off()
  70. axes_disable_scientific(a)
  71. a.set_aspect('equal')
  72. a.spines['left'].set_position(('outward', 4))
  73. a.spines['bottom'].set_position(('outward', 4))
  74. #t, p = ttest_rel(grtvals, mvivals) # paired t-test
  75. #a.add_artist(AnchoredText('p$=$%.2g' % p, loc='upper left', frameon=False))
  76. # stripplot movie and grating mean firing rates during control condition, for all mseu:
  77. np.random.seed(0) # to get identical horizontal jitter in strip plots on every run
  78. figsize = DEFAULTFIGURESIZE
  79. logmin, logmax = -2, 2
  80. logticks = np.array([-2, -1, 0, 1, 2])
  81. mvivals, grtvals = [], []
  82. for mseustr in mvimseustrs:
  83. mvival = mviresp.loc[mseustr, 'nat', 'none', False]['meanrate']
  84. if pd.isna(mvival):
  85. continue
  86. mvivals.append(mvival)
  87. for mseustr in grtmseustrs:
  88. grtval = grtresp.loc[mseustr, 'none', False]['meanrate']
  89. if pd.isna(grtval):
  90. continue
  91. grtvals.append(grtval)
  92. mvivals = np.asarray(mvivals)
  93. grtvals = np.asarray(grtvals)
  94. f, a = plt.subplots(figsize=figsize)
  95. wintitle('%s movie grating stripplot %s %s' % ('meanrate', 'none', False))
  96. # plot y=0 line:
  97. a.axhline(y=0, ls='--', marker='', color='lightgray', zorder=-np.inf)
  98. data = pd.DataFrame.from_dict({'Movie':mvivals, 'Grating':grtvals},
  99. orient='index').transpose()
  100. sns.stripplot(ax=a, data=data, clip_on=False, marker='.',
  101. color='None', edgecolor='black', size=np.sqrt(50))
  102. # plot mean with short horizontal lines:
  103. #meanmvival, meangrtval = gmean(mvivals), gmean(grtvals)
  104. #a.plot([-0.25, 0.25], [meanmvival, meanmvival], '-', lw=2, c='red', zorder=np.inf)
  105. #a.plot([0.75, 1.25], [meangrtval, meangrtval], '-', lw=2, c='red', zorder=np.inf)
  106. a.set_ylabel('Firing rate (spk/s)')
  107. a.set_yscale('log')
  108. a.set_ylim(10**logmin, 10**logmax)
  109. a.set_yticks(10.0**logticks)
  110. a.tick_params(bottom=False)
  111. a.minorticks_off()
  112. axes_disable_scientific(a, axiss=[a.yaxis]) # don't do it on x axis, messes up x label
  113. a.spines['bottom'].set_position(('outward', 5))
  114. a.spines['bottom'].set_visible(False)
  115. # scatter plot blank movie meanrates:
  116. figsize = DEFAULTFIGURESIZE[0]*1.02, DEFAULTFIGURESIZE[1] # tweak to make space for log units
  117. logmin, logmax = -1.5, 2
  118. logticks = np.array([-1, 0, 1, 2])
  119. #log0min = logmin + 0.05
  120. for kind in ['nat']:#MVIKINDS:
  121. for st8 in ['none']:#ALLST8S:
  122. f, a = plt.subplots(figsize=figsize)
  123. wintitle('opto meanrate blank movie %s %s' % (kind, st8))
  124. rons, roffs, exmplis, exmplmseustrs, normlis = [], [], [], [], []
  125. keptmseui = 0 # manually init and increment instead of using enumerate()
  126. for mseustr in mvimseustrs:
  127. meanrate = mviresp.loc[mseustr, kind, st8]['blankmeanrate']
  128. snr = mviresp.loc[mseustr, kind, st8]['snr']
  129. if meanrate.isna().any(): # missing one or both meanrates
  130. continue
  131. if (snr < SNRTHRESH).all(): # neither condition has decent SNR
  132. continue
  133. rons.append(meanrate[True])
  134. roffs.append(meanrate[False])
  135. rates = mviresp.loc[mseustr, kind, st8]['blankrates']
  136. #_, pval = ttest_ind(rates[False], rates[True], equal_var=False)
  137. #sgnfs.append(pval < SCATTERPTHRESH) # bool
  138. fig1.loc[mseustr, 'blankmeanrate'] = meanrate[False], meanrate[True] # save
  139. fig1.loc[mseustr]['blankrates'] = rates # save trial-wise values
  140. if mvimseu2exmpli.get(mseustr) == fig1exmpli:
  141. exmplis.append(keptmseui)
  142. exmplmseustrs.append(mseustr)
  143. else:
  144. normlis.append(keptmseui)
  145. keptmseui += 1 # manually increment
  146. rons = np.asarray(rons)
  147. roffs = np.asarray(roffs)
  148. # replace off-scale low values with log0min, so the points remain visible:
  149. #pltrons, pltroffs = rons.copy(), roffs.copy()
  150. #pltrons[pltrons <= 10**logmin] = 10**log0min
  151. #pltroffs[pltroffs <= 10**logmin] = 10**log0min
  152. # plot y=x line:
  153. xyline = [10**logmin, 10**logmax], [10**logmin, 10**logmax]
  154. a.plot(xyline[0], xyline[1], '--', color='gray', zorder=-1)
  155. # plot normal (non-example) points:
  156. a.scatter(rons[normlis], roffs[normlis], clip_on=False,
  157. marker='.', c='None', edgecolor=st82clr[st8], s=DEFSZ)
  158. # plot example points, one at a time:
  159. for exmpli, mseustr in zip(exmplis, exmplmseustrs):
  160. marker = exmpli2mrk[mvimseu2exmpli[mseustr]]
  161. c = exmpli2clr[mvimseu2exmpli[mseustr]]
  162. sz = exmpli2sz[mvimseu2exmpli[mseustr]]
  163. lw = exmpli2lw[mvimseu2exmpli[mseustr]]
  164. a.scatter(rons[exmpli], roffs[exmpli], clip_on=False,
  165. marker=marker, c=c, s=sz, lw=lw)
  166. a.set_xlabel('Suppression FR (spk/s)')
  167. a.set_ylabel('Feedback FR (spk/s)')
  168. a.set_xscale('log')
  169. a.set_yscale('log')
  170. a.set_xlim(10**logmin, 10**logmax)
  171. a.set_ylim(10**logmin, 10**logmax)
  172. a.set_xticks(10.0**logticks)
  173. a.set_yticks(a.get_xticks()) # make log scale y ticks the same as x ticks
  174. a.minorticks_off()
  175. axes_disable_scientific(a)
  176. a.set_aspect('equal')
  177. a.spines['left'].set_position(('outward', 4))
  178. a.spines['bottom'].set_position(('outward', 4))
  179. #t, p = ttest_rel(rons, roffs) # paired t-test
  180. #a.add_artist(AnchoredText('p$=$%.2g' % p, loc='lower right', frameon=False))
  181. #mu = rons.mean(), roffs.mean()
  182. #txt = '$\mathregular{\mu=%.1f, %.1f}$' % mu
  183. #a.add_artist(AnchoredText(txt, loc='upper left', frameon=False))
  184. # scatter plot blank movie burst ratio:
  185. figsize = DEFAULTFIGURESIZE[0]*1.05, DEFAULTFIGURESIZE[1] # tweak to make space for log units
  186. logmin, logmax = -3, 0
  187. logticks = np.array([-3, -2, -1, 0])
  188. for kind in ['nat']:#MVIKINDS:
  189. for st8 in ['none']:#ALLST8S:
  190. f, a = plt.subplots(figsize=figsize)
  191. wintitle('opto burst ratio blank movie %s %s' % (kind, st8))
  192. brons, broffs, exmplis, exmplmseustrs, normlis = [], [], [], [], []
  193. keptmseui = 0 # manually init and increment instead of using enumerate()
  194. for mseustr in mvimseustrs:
  195. br = mviresp.loc[mseustr, kind, st8]['blankmeanburstratio']
  196. snr = mviresp.loc[mseustr, kind, st8]['snr']
  197. if br.isna().any(): # missing for at least one opto condition
  198. continue
  199. if (snr < SNRTHRESH).all(): # neither condition has decent SNR
  200. continue
  201. brons.append(br[True])
  202. broffs.append(br[False])
  203. burstratios = mviresp.loc[mseustr, kind, st8]['blankburstratios']
  204. #_, pval = ttest_ind(burstratios[False], burstratios[True], equal_var=False)
  205. #sgnfs.append(pval < SCATTERPTHRESH) # bool
  206. fig1.loc[mseustr, 'blankmeanburstratio'] = br[False], br[True] # save
  207. fig1.loc[mseustr]['blankburstratios'] = burstratios # save trial-wise values
  208. if mvimseu2exmpli.get(mseustr) == fig1exmpli:
  209. exmplis.append(keptmseui)
  210. exmplmseustrs.append(mseustr)
  211. else:
  212. normlis.append(keptmseui)
  213. keptmseui += 1 # manually increment
  214. brons, broffs = np.asarray(brons), np.asarray(broffs)
  215. # plot y=x line:
  216. xyline = [10**logmin, 10**logmax], [10**logmin, 10**logmax]
  217. a.plot(xyline[0], xyline[1], '--', color='gray', zorder=-1)
  218. # plot normal (non-example) points:
  219. a.scatter(brons[normlis], broffs[normlis], clip_on=True, # clip_on=False fails
  220. marker='.', c='None', edgecolor=st82clr[st8], s=DEFSZ)
  221. # plot example points, one at a time:
  222. for exmpli, mseustr in zip(exmplis, exmplmseustrs):
  223. marker = exmpli2mrk[mvimseu2exmpli[mseustr]]
  224. c = exmpli2clr[mvimseu2exmpli[mseustr]]
  225. sz = exmpli2sz[mvimseu2exmpli[mseustr]]
  226. lw = exmpli2lw[mvimseu2exmpli[mseustr]]
  227. a.scatter(brons[exmpli], broffs[exmpli], clip_on=True, # clip_on=False fails
  228. marker=marker, c=c, s=sz, lw=lw)
  229. a.set_xlabel('Suppression BR') # keep it short to maximize space for axes
  230. a.set_ylabel('Feedback BR')
  231. a.set_xscale('log')
  232. a.set_yscale('log')
  233. a.set_xlim(10**logmin, 10**logmax)
  234. a.set_ylim(10**logmin, 10**logmax)
  235. a.set_xticks(10.0**logticks)
  236. a.set_yticks(a.get_xticks()) # make log scale y ticks the same as x ticks
  237. a.minorticks_off()
  238. axes_disable_scientific(a)
  239. a.set_aspect('equal')
  240. a.spines['left'].set_position(('outward', 4))
  241. a.spines['bottom'].set_position(('outward', 4))
  242. #t, p = ttest_rel(brons, broffs) # paired t-test
  243. #a.add_artist(AnchoredText('p$=$%.2g' % p, loc='upper left', frameon=False))
  244. # scatter plot blank and blankcond grating meanrates:
  245. figsize = DEFAULTFIGURESIZE[0]*1.02, DEFAULTFIGURESIZE[1] # tweak to make space for log units
  246. logmin, logmax = -1.5, 2
  247. logticks = np.array([-1, 0, 1, 2])
  248. #log0min = logmin + 0.05
  249. for st8 in ['none']:#ALLST8S:
  250. for blnkname, blnksname in {'blankmeanrate':'blankrates',
  251. 'blankcondmeanrate':'blankcondrates'}.items():
  252. f, a = plt.subplots(figsize=figsize)
  253. wintitle('opto meanrate %s grating %s' % (blnkname, st8))
  254. rons, roffs, exmplis, exmplmseustrs, normlis = [], [], [], [], []
  255. keptmseui = 0 # manually init and increment instead of using enumerate()
  256. for mseustr in grtmseustrs:
  257. trialis = grtresp.loc[mseustr, st8]['trialis'] # non-blank & blank trialis
  258. if trialis.isna().any(): # missing for at least one opto condition
  259. continue
  260. ntrials = { opto:len(trialis[opto]) for opto in OPTOS } # should be equal
  261. blnkratesfull = pd.Series({ opto:np.full(ntrials[opto], np.nan) # pad
  262. for opto in [False, True] })
  263. meanrate = grtresp.loc[mseustr, st8][blnkname]
  264. if meanrate.isna().any(): # missing for at least one opto condition, can't plot
  265. fig3.loc[mseustr][blnksname] = blnkbrsfull # save nans for all trials
  266. continue
  267. rons.append(meanrate[True])
  268. roffs.append(meanrate[False])
  269. rates = grtresp.loc[mseustr, st8]['rates'] # trial-wise
  270. nnblnktrials = { opto:len(rates[opto]) for opto in OPTOS } # num non-blank trials
  271. blnkrates = grtresp.loc[mseustr, st8][blnksname]
  272. if blnksname == 'blankrates':
  273. for opto in OPTOS:
  274. blnkratesfull[opto][:nnblnktrials[opto]] = blnkrates[opto]
  275. else: # blnksname == 'blankcondrates':
  276. for opto in OPTOS:
  277. blnkratesfull[opto][nnblnktrials[opto]:] = blnkrates[opto]
  278. fig3.loc[mseustr, blnkname] = meanrate[False], meanrate[True] # save
  279. fig3.loc[mseustr][blnksname] = blnkratesfull # save padded trial-wise values
  280. if mseustr in grtmseu2exmpli:
  281. exmplis.append(keptmseui)
  282. exmplmseustrs.append(mseustr)
  283. else:
  284. normlis.append(keptmseui)
  285. keptmseui += 1 # manually increment
  286. rons = np.asarray(rons)
  287. roffs = np.asarray(roffs)
  288. # replace off-scale low values with log0min, so the points remain visible:
  289. #pltrons, pltroffs = rons.copy(), roffs.copy()
  290. #pltrons[pltrons <= 10**logmin] = 10**log0min
  291. #pltroffs[pltroffs <= 10**logmin] = 10**log0min
  292. # plot y=x line:
  293. xyline = [10**logmin, 10**logmax], [10**logmin, 10**logmax]
  294. a.plot(xyline[0], xyline[1], '--', color='gray', zorder=-1)
  295. # plot normal (non-example) points:
  296. a.scatter(rons[normlis], roffs[normlis], clip_on=True, # fails
  297. marker='.', c='None', edgecolor=st82clr[st8], s=DEFSZ)
  298. # plot example points, one at a time:
  299. for exmpli, mseustr in zip(exmplis, exmplmseustrs):
  300. marker = exmpli2mrk[grtmseu2exmpli[mseustr]]
  301. c = exmpli2clr[grtmseu2exmpli[mseustr]]
  302. sz = exmpli2sz[grtmseu2exmpli[mseustr]]
  303. lw = exmpli2lw[grtmseu2exmpli[mseustr]]
  304. a.scatter(rons[exmpli], roffs[exmpli], clip_on=False,
  305. marker=marker, c=c, s=sz, lw=lw)
  306. a.set_xlabel('Suppression FR (spk/s)')
  307. a.set_ylabel('Feedback FR (spk/s)')
  308. a.set_xscale('log')
  309. a.set_yscale('log')
  310. a.set_xlim(10**logmin, 10**logmax)
  311. a.set_ylim(10**logmin, 10**logmax)
  312. a.set_xticks(10.0**logticks)
  313. a.set_yticks(a.get_xticks()) # make log scale y ticks the same as x ticks
  314. a.minorticks_off()
  315. axes_disable_scientific(a)
  316. a.set_aspect('equal')
  317. a.spines['left'].set_position(('outward', 4))
  318. a.spines['bottom'].set_position(('outward', 4))
  319. #t, p = ttest_rel(rons, roffs) # paired t-test
  320. #a.add_artist(AnchoredText('p$=$%.2g' % p, loc='lower right', frameon=False))
  321. #mu = rons.mean(), roffs.mean()
  322. #txt = '$\mathregular{\mu=%.1f, %.1f}$' % mu
  323. #a.add_artist(AnchoredText(txt, loc='upper left', frameon=False))
  324. # scatter plot blank and blank cond grating burst ratio:
  325. figsize = DEFAULTFIGURESIZE[0]*1.05, DEFAULTFIGURESIZE[1] # tweak to make space for log units
  326. logmin, logmax = -3, 0
  327. logticks = np.array([-3, -2, -1, 0])
  328. for st8 in ['none']:#ALLST8S:
  329. for blnkname, blnksname in {'blankmeanburstratio':'blankburstratios',
  330. 'blankcondmeanburstratio':'blankcondburstratios'}.items():
  331. f, a = plt.subplots(figsize=figsize)
  332. wintitle('opto burst ratio %s grating %s' % (blnkname, st8))
  333. brons, broffs, exmplis, exmplmseustrs, normlis = [], [], [], [], []
  334. keptmseui = 0 # manually init and increment instead of using enumerate()
  335. for mseustr in grtmseustrs:
  336. trialis = grtresp.loc[mseustr, st8]['trialis'] # non-blank & blank trialis
  337. if trialis.isna().any(): # missing for at least one opto condition
  338. continue
  339. ntrials = { opto:len(trialis[opto]) for opto in OPTOS } # should be equal
  340. blnkbrsfull = pd.Series({ opto:np.full(ntrials[opto], np.nan) # pad
  341. for opto in [False, True] })
  342. br = grtresp.loc[mseustr, st8][blnkname] # mean BR
  343. if br.isna().any(): # missing for at least one opto condition, can't plot
  344. fig3.loc[mseustr][blnksname] = blnkbrsfull # save nans for all trials
  345. continue
  346. brons.append(br[True])
  347. broffs.append(br[False])
  348. burstratios = grtresp.loc[mseustr, st8]['burstratios'] # trial-wise
  349. nnblnktrials = { opto:len(burstratios[opto]) for opto in OPTOS } # num non-blank trials
  350. blnkbrs = grtresp.loc[mseustr, st8][blnksname]
  351. if blnksname == 'blankburstratios':
  352. for opto in OPTOS:
  353. blnkbrsfull[opto][:nnblnktrials[opto]] = blnkbrs[opto]
  354. else: # blnksname == 'blankcondburstratios':
  355. for opto in OPTOS:
  356. blnkbrsfull[opto][nnblnktrials[opto]:] = blnkbrs[opto]
  357. fig3.loc[mseustr, blnkname] = br[False], br[True] # save
  358. fig3.loc[mseustr][blnksname] = blnkbrsfull # save padded trial-wise values
  359. if mseustr in grtmseu2exmpli:
  360. exmplis.append(keptmseui)
  361. exmplmseustrs.append(mseustr)
  362. else:
  363. normlis.append(keptmseui)
  364. keptmseui += 1 # manually increment
  365. brons, broffs = np.asarray(brons), np.asarray(broffs)
  366. # plot y=x line:
  367. xyline = [10**logmin, 10**logmax], [10**logmin, 10**logmax]
  368. a.plot(xyline[0], xyline[1], '--', color='gray', zorder=-1)
  369. # plot normal (non-example) points:
  370. a.scatter(brons[normlis], broffs[normlis], clip_on=True, # clip_on=False fails
  371. marker='.', c='None', edgecolor=st82clr[st8], s=DEFSZ)
  372. # plot example points, one at a time:
  373. for exmpli, mseustr in zip(exmplis, exmplmseustrs):
  374. marker = exmpli2mrk[grtmseu2exmpli[mseustr]]
  375. c = exmpli2clr[grtmseu2exmpli[mseustr]]
  376. sz = exmpli2sz[grtmseu2exmpli[mseustr]]
  377. lw = exmpli2lw[grtmseu2exmpli[mseustr]]
  378. a.scatter(brons[exmpli], broffs[exmpli], clip_on=True, # clip_on=False fails
  379. marker=marker, c=c, s=sz, lw=lw)
  380. a.set_xlabel('Suppression BR') # keep it short to maximize space for axes
  381. a.set_ylabel('Feedback BR')
  382. a.set_xscale('log')
  383. a.set_yscale('log')
  384. a.set_xlim(10**logmin, 10**logmax)
  385. a.set_ylim(10**logmin, 10**logmax)
  386. a.set_xticks(10.0**logticks)
  387. a.set_yticks(a.get_xticks()) # make log scale y ticks the same as x ticks
  388. a.minorticks_off()
  389. axes_disable_scientific(a)
  390. a.set_aspect('equal')
  391. a.spines['left'].set_position(('outward', 4))
  392. a.spines['bottom'].set_position(('outward', 4))
  393. #t, p = ttest_rel(brons, broffs) # paired t-test
  394. #a.add_artist(AnchoredText('p$=$%.2g' % p, loc='upper left', frameon=False))