Closed dengesCU closed 1 year ago
@dengesCU, Thanks for the diagnosis, it definitely saved some me time. The solution is a little different. There is a counter for every set output
. That way, nested loops are also automatically handled.
Great, thank you! Particularly for being so quick! Much appreciated.
I installed the developer version and it seems to work as intended now. Btw, it should read @main and not @master in the installation instructions for the Development version in the readme
gnuplot_kernel successfully recognizes when there are multiple
plot
instructions such asHowever, when using
for
loops such asthis fails and only the last plot is displayed.
Cause: In the function
def add_inline_image_statements(self, code):
in kernel.py the code is scanned for plot statements and for each plot statement aset output
line is added (unless when using multiplot). Thus, each plot in the loop will be written to the same output file, hence overwriting any previous plot. Consequentially, only the last plot is displayed.Possible fix: Detect for loops. When a for loop is detected, add a counter variable that is incremented in the loop everytime. Append the counter to the filename for the output file (which should not overwrite previous plots then).