Skip to main content

Posts

Matlab plot figure modifying tips pixed dpi relationship

Matlab  plot figure all basic operation =========================== x = [1:5]; y = [7 8 1 9  10] h =figure plot(x,y) hold on plot(x, y+5); % change axis properties set(gca,'box','off'); % remove box around figure set(gca,'FontSize',fontsize_tick-1); % set tick size in figure set(gca,'LooseInset',get(gca,'TightInset'));  % if you want to remove space on right of figure xlabel(commonLabelWindow,'fontsize' , fontsize_label); ylabel('Average AT-skew','fontsize' , fontsize_label_special); xlim ( [ min(myX)   max(myX)]) ylim ( [ min( [myY1  myY2  ])   max([ myY1  myY2  ])  ]) % change size of figure http://www.mathworks.com/help/matlab/creating_plots/positioning-figures.html %  set size of figure's "drawing" area on screen ( 5.5 cm  width ) by ( 4.0 cm height) set(gcf, 'Units','centimeters', 'Position',[0 0 5.5 4.0]) % change resolution 600 dpi http...

R tutorial

Install R in linux ============ In CRAN home page, the latest version is not available. So, in fedora, Open the terminal yum list R  --> To check the latest available version of r yum install R --> install R version yum update R --> update current version to latest one 0 find help ============ ?exact topic name (  i.e.   ?mean ) 0.0 INSTALL 3rd party package  ==================== install.packages('mvtnorm' , dependencies = TRUE , lib='/home/alamt/myRlibrary/')   #  install new package BED file parsing (Always use read.delim it is the best) library(MASS) #library(ggplot2) dirRoot="D:/research/F5shortRNA/TestRIKEN/Rscripts/" dirData="D:/research/F5shortRNA/TestRIKEN/" setwd(dirRoot) getwd() myBed="test.bed" fnmBed=paste(dirData, myBed, sep="") # ccdsHh19.bed   tmp.bed ## Read bed use read.delim - it is the  best mybed=read.delim(fnmBed, header = FALSE, sep = "\t", quote = ...

Java run with external jar

1. When classpath is used, jar command is ignored . So use "classpath" with class file and "cp" with jar file 2. NEVER FORGET TO PUT : even you use only 1 external jar. In some cases you will get compilation error if you don't put : java  -classpath  /media/Data/eclipseWorkspace/myExternalJar/commons-math-1.2.jar :   com.cbrc.motifmap.CombinationOfTF java  -cp /media/Data/eclipseWorkspace/myExternalJar/commons-math-1.2.jar:    -jar myJar.jar

java comparator sorted linked hash map treemap

////////////  inner class /////////////////     class ValueComparator implements Comparator {         LinkedHashMap  base;         public ValueComparator(LinkedHashMap hMap) {             this.base = hMap;         }         public int compare(Object a, Object b) {             Myclass obj1 = (Myclass) base.get(a);             Myclass obj2 = (Myclass) base.get(b);             if( obj1.getRankDistance() > obj2.getRankDistance()    ) {                 return -1;             }  else {             ...

LATEX basic command

Float 3 float Table, Figure, Picture Caption can be given only to figure tabular   is just an array. Not float \begin{table} \begin{center} \begin{tabular} { |r | r | r | c | } \hline \multicolumn{4}{c}{this is header of table} \\ \hline 1 & 2 & 3 & 4 \\ \hline \multicolumn{4}{c}{this is text} \\ \hline \bf 4 & \it 5 & 6 & val \\ \hline \hline \end{tabular} \caption{mycaption} \label{lbl:mylabel1} \end{center} \end{table} Math environment running text  $  write here $  centered & new line \[  ]\  \[ \left( \begin{array}{cc} a & b \end{array} \right) \] \[  2^{2^{\cdot{^2}}}  \] Bibtex ..... at end of document write \bibliography{mybib.bib} to cite \cite{label1} \cite{lab1} \bibliography{1} \bibliographystyle{plain} % alpha / unsrt / siam / ieeetr \end{document}

LATEX beamer tutorial

% This text is proprietary. % It's a part of presentation made by myself. % It may not used commercial. % The noncommercial use such as private and study is free % Dec 2007 % Author: Sascha Frank % University Freiburg % www.informatik.uni-freiburg.de/~frank/ % % \documentclass{beamer} \setbeamertemplate{navigation symbols}{} \usetheme{Warsaw} \beamersetuncovermixins{\opaqueness {25}}{\opaqueness {15}} \begin{document} \title{Beamer Class Warsaw} \author{Sascha Frank} \date{\today} \begin{frame} \titlepage \end{frame} \begin{frame}\frametitle{Table of contents}\tableofcontents \end{frame} \section{Section no.1} \begin{frame}\frametitle{Title} Each frame should have a title. \end{frame} \subsection{Subsection no.1.1  } \begin{frame} Without title somethink is missing. \end{frame} \section{Section no. 2} \subsection{Lists I} \begin{frame}\frametitle{unnumbered lists} \begin{itemize} \item Introduction to  \LaTeX \item Course 2 \item Termpapers and presentations with \LaTeX \item...

C/C++ header file inlcude "" OR<> how to use std ?

Suppose your project current directory is 0.   /home/myproj/ Let assume include foder are 1. /home/include1/ 2. /home/include2/ ==>  # include "myhead.h"    search for directory in order 0 , then 1 , then 2 AS IT SEARCH CURRENT DIR FIRST, USUALLY user defined headers used in this way. ==>  # include    search for directory in order 1 , then 2 , then 0 AS IT SEARCH INCLUDE DIR FIRST,  standard headers used in this way. Header file extension: ================== In C : In early days it was .hxx, .hpp . Then it was .h     #include myheader.hxx     #include myheader.hp     #include myheader.hpp In C++ : No extension. They are included in namespaces.    #include    using namespace std; // use original namespace you can also use it in code as std::stringfunction