I'm a little late but I just figured out a pretty neat way to do this using :file and without using :var.
As the other anwser already pointed out plt.show() doesn't produce output.
However you can use :results output file instead of :results file (which is the same as :results value file). This means that the data to create the image is taken from stdout ...
You have two issue here and probably should have 2 questions. First is indent second is bracket matching for smartparens
You can indent the whole tangled source file after saving it. This idea is taken from https://github.com/grettke/help
The relevant code is
(defun help/org-babel-post-tangle-hook-fn ()
(indent-region (point-min) (point-max)...
You could just type in where you'd mention the language of the source block.
This should work:
#+begin_src in :tangle yes
Code goes here
If your file is named config.org, this will tangle to config.in.
Not sure whether this is good practice, but you could also use something generic like sh, and then provide a filename to tangle to:
#+begin_src sh :...