Skip to content

Instantly share code, notes, and snippets.

@yuqinc
yuqinc / README.md
Last active October 17, 2015 19:56
R_code_scatter_plot_with_regression

2D-scatter-hydrogen-bond-analysis-

beautiful_soup

@yuqinc
yuqinc / HB scatter with color patch and color bar
Created July 9, 2015 17:28
HB scatter with color patch and color bar
#!/home/caiy/anaconda/bin/python
import numpy as np
import pandas as pd
from pylab import *
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib import rc, rcParams
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.patches as patches
@yuqinc
yuqinc / circle scatter
Created July 6, 2015 00:11
painting like kandinsky
#!/home/caiy/anaconda/bin/python
import numpy as np
import pandas as pd
from pylab import *
import matplotlib.pyplot as plt
from matplotlib import rc, rcParams
from sys import argv
import sys, getopt
@yuqinc
yuqinc / bash shell script
Created July 2, 2015 01:19
this beautiful soup + urllib2 script works well with bash shell script, scrap data into one single file
#!/bin/bash
#filename="female_filmstar_urlist.out"
#filename="test.out"
#while IFS='' read -r line || [[-N $line]];
#do
# url=$line
# echo $url
# python beautiful_soup_step2.py $url
#done
@yuqinc
yuqinc / wget bash loop
Created July 2, 2015 01:15
bash to wget all pages
#!/bin/bash
for i in `seq 1 43`;
do
wget http://healthyceleb.com/category/statistics/filmstars/female-filmstars/
page/${i}/
done
@yuqinc
yuqinc / beautiful_soup web scraping
Created July 2, 2015 01:14
beautiful_soup web scraping
#!/home/caiy/anaconda/bin/python
import os
import sys, getopt
from sys import argv
from bs4 import BeautifulSoup
import urllib2
import pandas as pd
import numpy as np
@yuqinc
yuqinc / boxplot
Created July 1, 2015 01:28
boxplot for binding energy
#!/home/caiy/anaconda/bin/python
from pylab import *
from matplotlib import rc, rcParams
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
import numpy
#import matplotlib.font_manager as font_manager
#rcParams['font.weight']='medium'
@yuqinc
yuqinc / dataframe stacked bar chart
Last active August 29, 2015 14:24
stacked bar chart, read from csv file as Dataframe
#!/home/caiy/anaconda/bin/python
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from pylab import *
from matplotlib import rc, rcParams
def set_pub():
@yuqinc
yuqinc / Heatmap for HB interactions between DNA and protein
Created June 30, 2015 20:45
This draws the heatmap for hydrogen interaction between DNA and proteins.
#!/home/caiy/anaconda/bin/python
import numpy as np
import pandas as pd
from pylab import *
import matplotlib.pyplot as plt
from matplotlib import rc, rcParams
def set_pub():
rc('font', weight='bold') # bold fonts are easier to see
@yuqinc
yuqinc / bar_chart_with_number_labels
Created June 30, 2015 20:19
This is a python script to draw bar chart with errors and labels on top
from pylab import *
from matplotlib import rc, rcParams
import matplotlib.pyplot as plt
import numpy as np
def set_pub():
rc('font', weight='bold') # bold fonts are easier to see
rc('ytick', labelsize=15) # tick labels bigger
rc('xtick', labelsize=15)
#rc('lines', lw=1, color='k') # thicker black lines (no budget for color!)