diff --git a/pystencils/backends/cbackend.py b/pystencils/backends/cbackend.py index 27d6480124ee8b64d6caac19bac65aed20e57d84..654b92b82f8c5e225f26abd5a5c14ce0b113a43e 100644 --- a/pystencils/backends/cbackend.py +++ b/pystencils/backends/cbackend.py @@ -227,7 +227,7 @@ class CBackend: def _print_LoopOverCoordinate(self, node): counter_symbol = node.loop_counter_name - start = f"int {counter_symbol} = {self.sympy_printer.doprint(node.start)}" + start = f"int64_t {counter_symbol} = {self.sympy_printer.doprint(node.start)}" condition = f"{counter_symbol} < {self.sympy_printer.doprint(node.stop)}" update = f"{counter_symbol} += {self.sympy_printer.doprint(node.step)}" loop_str = f"for ({start}; {condition}; {update})" diff --git a/pystencils/stencil.py b/pystencils/stencil.py index 668ea96bfa8f538ce5f550515af96559671ae27d..3d345990a00a4c329eedbb56e2c9b469a2622d10 100644 --- a/pystencils/stencil.py +++ b/pystencils/stencil.py @@ -357,7 +357,7 @@ def plot_2d(stencil, axes=None, figure=None, data=None, textsize='12', **kwargs) else: return 0 text_position = [direction[c] + position_correction(direction[c]) for c in (0, 1)] - axes.text(*text_position, annotation, verticalalignment='center', + axes.text(x=text_position[0], y=text_position[1], s=annotation, verticalalignment='center', zorder=30, horizontalalignment='center', size=textsize, bbox=dict(boxstyle=text_box_style, facecolor='#00b6eb', alpha=0.85, linewidth=0))