Creating Energy Band Diagrams for Solar cells and LED

Posted on Mon 11 September 2017 in Misc • Tagged with Python

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 …

Continue reading

Tab autocompletetion with python interpreter in bash terminal

Posted on Sat 29 October 2016 in Misc • Tagged with Linux, python

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 …


Continue reading

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

Posted on Wed 30 March 2016 in Misc • Tagged with Python

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 …

Continue reading

All entries of array except certain indices in octave/matlab

Posted on Wed 07 December 2011 in Misc • Tagged with Matlab, octave

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 …


Continue reading

Beamer Themes

Posted on Sun 18 April 2010 in Misc • Tagged with beamer, Free Software, Latex

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 …


Continue reading

Adding a title to colobar in Matlab

Posted on Sun 21 March 2010 in Misc • Tagged with 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 …

Continue reading

Python

Posted on Sun 17 January 2010 in Misc • Tagged with 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.


Smooth image in matlab

Posted on Sun 10 January 2010 in Misc • Tagged with graphs, 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 …


Continue reading