Skip to content

Commit dd22f89

Browse files
abukajccluri
authored andcommitted
Error propagation figure tuning (#103)
* 'Fixed `gauss_2d_large()`. `kcsd.validation.csd_profile.gauss_2d_large(seed=63)` does not return NaN anymore. `repeatUntilValid()` decorator has been defined for that purpose. A simple test for the fix provided in the `__main__` section of the module. Note: The issue has not been solved by fixing distribution of the `zs` variable in order to provide backward-compatibility. * 2**32 - 1 included as possible alternative seed in the `kcsd.validation.csd_profile.repeatUntilValid()` decorator. * Protection of `repeatUntilValid()` decorator against (extremely unlikely) neverending loop of seeds. * `repeatUntilValid()` decorator reffactored Seed sequence generation moved to `seedSequence()` generator function. * `seedSequence()` generator function simplified (the generated sequence has changed though). * Remove unnecessary imports According to https://docs.python.org/3/library/builtins.html imports from `builtsin` are unnecessary. As `builtsin` is Python 3 only, their removal increases beckward-compatibility of the package. Fixes #77 * Error Propagation Maps figure I have included code which generates figure with EPMs (Fig. 7 at the moment). Also, `colorblind_friendly` module with definition of colorblind friendly colors is provided, which my code depends on. * Error propagation maps dependencies reduced The code of the `colorblind_friendly` module embedded in (copied into) the script generating error propagation maps. * Saving of figure of error propagation maps The figure is saved as "error_propagation.pdf". * Shabang provided * Error propagation map figure tuning Between-panel distance reduced. Smart precision of ticklabels in both subplots (before only left plot). * `chmod +x error_propagation.py`
1 parent f410408 commit dd22f89

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

figures/kCSD_properties/error_propagation.py

100644100755
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ def _BipolarColormap(name, negative, positive):
108108

109109
FIG_WIDTH = 17.0
110110
FIG_HEIGHT = 6.0
111-
FIG_WSPACE = 5.0
111+
FIG_WSPACE = 2.0
112112
FIG_TOP = 0.9
113113
FIG_BOTTOM = 0.15
114-
FIG_LEFT = 0.05
115-
FIG_RIGHT = 0.95
114+
FIG_LEFT = 0.125
115+
FIG_RIGHT = 0.875
116116

117117

118118
def maxabs(values):
@@ -188,8 +188,8 @@ def maxabs(values):
188188
if x == 0:
189189
ax.set_ylabel('Y (mm)')
190190
if y == 2:
191-
ax.text(-0.05,
192-
1.15,
191+
ax.text(-0.16,
192+
1.16,
193193
'A',
194194
fontsize=20,
195195
weight='bold',
@@ -224,8 +224,10 @@ def maxabs(values):
224224

225225
ax.set_aspect('equal')
226226
ax.set_xticks(ticks)
227+
ax.set_xticklabels(ticklabels)
227228
ax.set_xticks(ticks_minor, minor=True)
228229
ax.set_yticks(ticks)
230+
ax.set_yticklabels(ticklabels)
229231
ax.set_yticks(ticks_minor, minor=True)
230232
ax.set_ylabel('Y (mm)')
231233
ax.set_xlabel('X (mm)')
@@ -246,4 +248,4 @@ def maxabs(values):
246248
#format='%.2g',
247249
ticks=colorbar_ticks)
248250

249-
fig.savefig('error_propagation.pdf')
251+
fig.savefig('error_propagation.pdf')

0 commit comments

Comments
 (0)