Plot 12-bit tiff image with log scale colorbar using python & matplotlib.pyplot


The result is:

Show 12-bit tiff image with log scale colorbar using python & matplotlib.pyplot

Some of the output data from measuring equipment have 12-bit unsigned int data. In some case, tiff format is used to ensure the convenience of the users. Reading the 12-bit tiff file and plotting the 12-bit tiff file is very easy. In addition, you can increase the visibility of the output figure by using log scale colormap when you plotting the tiff file. This page shows how to plot 12-bit tiff file in log scale using python and matplotlib.pyplot. 2D gaussian distribution is used as an example data.

Draw two axis to one colorbar using python and matplotlib.pyplot


The result is:

Draw two axis to one colorbar using python and matplotlib.pyplot

In my post in 14th, Oct. 2018, I showed how to draw second tick axis on the colorbar. The method of plotting is not so good, so I'd like to show an improved way to draw second tick axis on the colorbar. This page shows how to draw two axis to one colorbar using python and matplotlib.pyplot. By adapting twinx to the colorbar axis and by shifting the position of labels and ticks, you can draw an figure like the example on this page.

Combine three 2D colorap in one figure using Python and Matplotlib.pyplot


The result is:
If you want to plot three 2D colormaps on one figure, the only feasible way is combining these three colormaps to one image. This can be achieved by corresponding three values to three primary elements, i.e. red, green, blue. However, interpretation of the completed figure is quite complex, and easiness of understanding for readers would be decreased. In my opinion, this way for plotting should be avoided.

If you want to plot three 2D colormaps on one figure, the only feasible way is combining these three colormaps to one image. This can be achieved by corresponding three values to three primary elements, i.e. red, green, blue. However, interpretation of the completed figure is quite complex, and easiness of understanding for readers would be decreased. In my opinion, this way for plotting should be avoided.


Listing up sequential 2D colormap with one common colorbar using python and matplotlib.pyplot


The concept is:

Listing up sequential 2D colormap with one common colorbar using python and matplotlib.pyplot

When you want to show a 2D colormap in a sequence, the simplest way to do it is just listing up the output figure like the left side of the above image. However, common information, that is xticks and colorbars, should be omitted to show useful colormap as large as possible. This page shows how to align 2D colormaps without useless information. Three figures are drawn sequentially: 1. full image, 2. without colorbar, and 3. witiout colorbar and xticks. A standalone colorbar will be drawn, plotted and saved at the first iteration of the sequence. By properly selecting the output figure on your tools such as LaTex or Microsoft Office, you can obtain the figure like the right side of the above image.

Draw three colormap with two colorbar using python and matplotlib.pyplot


The result is:

Draw three colormap with two colorbar using python and matplotlib.pyplot

This page shows an example of how to arrange three colormap with two colorbar. One colorbar corresponds two colormaps, while the other corresponds to one colormap. Gridspec enables us to properly adjust these positions in the figure.