Misc Articles


  • Mon 11 September 2017
  • Misc

Creating Energy Band Diagrams for Solar cells and LED

Energy band diagrams are used to visulize the electron and hole transport in Solar cells and LED research. I want to quickly draw them and came up with a python module. Here's an example on how to use this code. from Band_diagram import metal, semiconductor, plot # Define the metals and …

  • Sat 29 October 2016
  • Misc

Tab autocompletetion with python interpreter in bash terminal

I want to tab autocomplete commands in my python interpreter within bash terminal. This is very useful when I import a module and just want to browse through the methods and autocomplete. Found two ways to do it. Thanks to stack overflow posts. Method 1 (as mentioned here): This is …

  • Wed 30 March 2016
  • Misc

Dealing with plotting negative, zero and positive values in log scale

Sometimes you have to show positive, zero and negative number in log scale. However you cannot take log of negative numbers and zero. But one could approximate it with a log transform modulus as stated here. In Python with numpy: from numpy import sign, abs, log10 import matplotlib.pyplot as …

  • Wed 07 December 2011
  • Misc

All entries of array except certain indices in octave/matlab

In Octave or Matlab, some times one needs to eliminate certain elements in an array. For example, if a = [10,20,30,40,50,60]; and suppose I want to create a matrix "b" such that it has all the elements of "a" except 20 and 40. This can be …

  • Sun 18 April 2010
  • Misc

Beamer Themes

One can use Beamer to make high quality presentations using Latex code. To know more about beamer and its capabilities visit hereand here. Beamer comes with a set of default templates. However,it has capability to design new themes. Here, I will maintain a list of beamer themes shared …

  • Sun 21 March 2010
  • Misc

Adding a title to colobar in Matlab

To insert a title to the colorbar in matlab. Use the following code (Source): % Loads a data for the example load mandrill % Plots an image for the example image(X) % Inserts a colorbar. a handle is created t=colorbar; % sets the ylabel property of the handle t. set(get(t …

  • Sun 17 January 2010
  • Misc

Python

I am playing with Python for the first time. The syntax seems to be so natural. So many modules (numpy, scipy and matplotlib) for researchers/scientists. Cannot see any shortcoming at this point. Perhaps need more testing and implementation.

  • Sun 10 January 2010
  • Misc

Smooth image in matlab

In matlab, sometimes I prefer to plot a image for mesh data instead of surf and use view(2) (view(2) gives the top view of the surface plot). However, imagesc(x,y,z) shading 'interp' does not work. This problem can be solved by using: pcolor(x,y,z …