Making a subplot span several columns with pyplot

Currently, I’m using PyPlot a lot. There was one issue bugging me for a few days now and this issue was the simply question how on earth a subplot spanning several columns could look like. There doesn’t seem to be any official documentation mentioning this and even the corresponding Stackoverflow article could only give some hints in the right direction. Finally I found the solution using trial and error:

import matplotlib.pyplot as plt

fig = plt.figure(figsize=(height_in,width_in), dpi=80)
ax1 = plt.subplot(221)
ax2 = plt.subplot(2,2,(3,4))
ax3 = plt.subplot(222)

In case you are wondering about the meaning of those strange numbers, I quote from the article cited above:

“These are subplot grid parameters encoded as a single integer. For example, “111” means “1×1 grid, first subplot” and “234” means “2×3 grid, 4th subplot”.

Alternative form for add_subplot(111) is add_subplot(1, 1, 1).”


Fixing a broken Matlab installation after an Ubuntu update

Today, I updated Ubuntu as usual and suddenly Matlab stopped working. Instead of starting up nicely, it only complained about some “segmentation violation”. Luckily however, I came across a rather simple solution to this problem. All I had to do was to install the “matlab-support” and “matlab-support-dev” packages via:

sudo aptitude install matlab-support
sudo aptitude install matlab-support-dev

and after that, Matlab worked like a charm again. I just wanted to share that insight in case anyone stumbles across the same problem one day. 🙂

Implementing cross correlation in Matlab without using xcorr

If you’ve ever wanted to implement the cross correlation function in Matlab without using the inbuilt xcorr function, this post might be of some help for you.

This is how such a function could look like:

%Implementation of the cross correlation function
function [result] = crossCorrelation(signalA,signalB)
  signalALength = size(signalA,1);
  signalBLength = size(signalB,1);

  result = zeros(1, signalALength + signalBLength - 1 );
  resultLength = size(result,2);

  for m = 1 : resultLength
    arg = (m - signalALength);

    if(arg < 0)
      negativeCondition = 1;
      limit = signalALength + arg;
      negativeCondition = 0;
      limit = signalALength - arg;

    for n = 1:limit
      if (negativeCondition)
        result(m) = result(m) + signalA(n) * signalB(n - arg);
        result(m) = result(m) + signalA(arg + n) * signalB(n);




Multiresolution Elastic Matching

It has been a while since I last updated this blog. But today I finally found the time to do it and share another presentation summary with you.

This time the summary is about the paper “Multiresolution Elastic Matching” from Ruzena Bajcsy and Stane Kovačič.

The summary introduction goes as follows:

The general idea behind the work presented in”Multiresolution Elastic Matching” is to develop a mechanism to match “an explicit 3-dimensional pictorial model to locally variant data”.In other words, two existing representations (one model representation and one input representation) are put into correspondence. To achieve this goal,rigid transforms are used to account for global misalignments, while elastic deformations are appliedfor local shape differences. A coarse-to-fine strategy(called multiresolution elastic matching) is the heart of the presented paper and leads to more efficient computations and improved convergence of the matching process in general.

You can find the summary here: Multiresolution Elastic Matching – a summary.

TU Wien – Rendering course

As I’m currently studying for a Realistic Image Synthesis course, I stumbled upon this awesome rendering lecture from TU Wien. Its content can be found online:

Károly Zsolnai does a great job explaining the basics of different rendering techniques. I can really recommend it to anyone new to the field of computer graphics. You will learn a lot; I promise.

XML3D based Molecular Structure Visualization using BALLView and Ballaxy

Some time ago (in April 2014) I finished my bachelor thesis at the chair for Bioinformatics of Prof. Dr. Hans-Peter Lenhof.

The topic of the thesis was “XML3D based Molecular Structure Visualization using BALLView and Ballaxy“.

BALLView and Ballaxy are two projects which were (and actually still are) being developed at that chair. Unfortunately there is no live instance of a XML3D enabled Ballaxy server available at the moment but as the code has been licensed under the (L)GPL I might just set one up someday.

Till then you have to check the thesis out for yourself if you want to find out more about its content. You can find it here.

Fast Difference Schemes for Edge Enhancing Beltrami Flow

Once again I would like to publish a summary of a paper. This time it’s all about the Fast Difference Schemes for Edge Enhancing Beltrami Flow. The summary has been created during another seminar at my university. The introduction can be found below.

The general idea behind the work presented in [1] is to exploit additive operator splitting (AOS) methods [2] [3] in order to speed up the Beltrami Flow, which the authors of [1] consider to be “one of the most effective denoising algorithms in image processing”. Another goal is to rearrange Beltrami Flow equations to gain a semi-implicit linearized difference scheme and present the results of 2D and 3D gray level and color images.

The whole summary can be found here: Fast Difference Schemes for Edge Enhancing Beltrami Flow – A summary. I hope this summary can be of use for someone. Enjoy! 🙂