Showing posts with label color. Show all posts
Showing posts with label color. Show all posts

Sunday, April 11, 2010

ROOT: make plots more beautiful

http://ultrahigh.org/2007/08/20/making-pretty-root-color-palettes/

In ROOT, we can change its default to make plots more beautiful.

void
set_plot_style()
{
const Int_t NRGBs = 5;
const Int_t NCont = 255;

Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
gStyle->SetNumberContours(NCont);
}

Monday, April 20, 2009

Linux: how to change background color of xdvi

If you want to change background color or whatever other settings of one application under X windows, for example, xdvi, you could set it in your file: ~/.Xdefaults by

xdvi*background: white
xdvi*foreground: black

.

Note: your changes will be starting after you log out and in.

Thursday, December 18, 2008

Linux:shell:Bash: How to change color of your shell printout


You could use 'echo -e' to change your printout text and background color by some color variables. One of the easiest ways to use them is to define shell variable, for example, define those variables in your shell script:

red='\e[0;31m'
RED='\e[1;31m'

blue='\e[0;34m'

BLUE='\e[1;34m'

cyan='\e[0;36m'

CYAN='\e[1;36m'
NC='\e[0m' # No Color


. '\e[0;36m': 0's place is the color of background (0, no effect, 1, bold, 4, underline) and 36 is the text color. You also can change background colors due to color values in the color table. For example, '\e[41;34m' changes background color to red and text color to blue.

How to print?

echo -e "$red These texts are in red$NC" #you must use '-e' to enable interpretation of the backslash-escaped characters, see echo's help.

or if you want to use it in 'printf':

printf "%s\n" "`echo -e $red`These texts are in red`echo -e $NC`"

There is a table of color values attached (this table is from the link). You can find color values what you want.

Tuesday, August 19, 2008

Latex: change row color of table

An example here:

\usepackage[table]{xcolor}
(if you use pdflatex and/or beamer, perhaps you need to transit 'table' by
\documentclass[xcolor=table..]{beamer} or you will have an error like:
! LaTeX Error: Option clash for package xcolor.
)

\begin{table}
\centering
\rowcolors{2}{gray!10}{}\tiny
\begin{tabular}{c||cc|cc}\hline\hline
....
\end{tabular}
\caption{...}
\end{table}

Tuesday, May 6, 2008

Linux:shell: how to change color of your prompt

I find a good paper:

http://www.funtoo.org/en/articles/linux/tips/prompt/

to teach you how to change the color of your prompt. Actually I did this change long time ago, however, there is a problem in my setting. I didn't use "\[" and "\]" to include the string so that my shell cannot precisely calculate word-wrap and once I input long strings in the command line, my line will mass up.

Friday, April 27, 2007

ROOT: how to change palette color

root [2] gStyle->SetPalette(1)
root [3] eqcd->Draw("mucalmet:metsig", "Nisotrk!=0","colz")

Locations of visitors to this page