Labels

Sunday, December 27, 2020

Install latex in Chromebook

// install basic version

sudo apt-get install texlive-latex-base

sudo apt-get install biblatex

sudo apt-get install texlive-fonts-recommended

#sudo apt-get install texlive-science

sudo apt-get remove *texlive*doc


// Cannot determine type of tlpdb

apt-get install xzdec

tlmgr init-usertree

// tlmgr: Remote repository is newer than local (2018 < 2020)

tlmgr option repository ftp://tug.org/historic/systems/texlive/2019/tlnet-final

// search the missed ".sty"

tlmgr search --global --file "/times.sty"

// install the package included ".sty" 

tlmgr install psnfss


Find sty file by yourself:
https://www.tug.org/texlive//Contents/live/texmf-dist/tex/latex/

Reference:

Saturday, December 19, 2020

Matplotlib notes

# adjust the tick font size 

ax.tick_params(axis='both', which='minor', labelsize=8)

#set tick to right side

ax.yaxis.tick_right()

# remove space between start and end of the axis
plt.margins(x=0)
ax.margins(x=0)
plt.rcParams['axes.xmargin'] = 0

# remove extra fig for subplot
fig.delaxes(axes[1][2])
axes[1,2].set_axis_off()
axes.flat[-1].set_visible(False)


# better minus symbol
matplotlib.rcParams['axes.unicode_minus'] = False

# fontsize
plt.rcParams['font.size'] = '16'


import matplotlib.pyplot as plt

SMALL_SIZE = 8
MEDIUM_SIZE = 10
BIGGER_SIZE = 12

plt.rc('font', size=SMALL_SIZE)          # controls default text sizes
plt.rc('axes', titlesize=SMALL_SIZE)     # fontsize of the axes title
plt.rc('axes', labelsize=MEDIUM_SIZE)    # fontsize of the x and y labels
plt.rc('xtick', labelsize=SMALL_SIZE)    # fontsize of the tick labels
plt.rc('ytick', labelsize=SMALL_SIZE)    # fontsize of the tick labels
plt.rc('legend', fontsize=SMALL_SIZE)    # legend fontsize
plt.rc('figure', titlesize=BIGGER_SIZE)  # fontsize of the figure title

Reference:



Matplotlib legend location

 


Reference:

https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.legend.html

Wednesday, December 16, 2020

Share Chrome-OS files to Linux beta

It is important that if we can access the files outside of the linux beta.

The process is very simple.

a. Open the Chrome OS Files app and find the directory you want to share.

b. Right-click on the folder you want to share and select the “Share with Linux” option.

c. Within the Linux container, these shared folders will be located at /mnt/chromeos/MyFiles/. From the Terminal app run cd /mnt/chromeos.

Enjoy it!


Reference:
https://chromeos.dev/en/linux/setup


Friday, December 11, 2020

A simple guide to Install scikit ODES

Here is a simple guid to install scikit-odes. Odes is a scikit toolkit for scipy to add extra ode solvers. Specifically it interfaces the Sundials solvers cvode, cvodes, ida and idas.


a) Install BLAS and LAPACK

>sudo apt-get install libopenblas-dev liblapack-dev


b) Install Sundials 5.1.0

>wget https://computing.llnl.gov/projects/sundials/download/sundials-5.1.0.tar.gz

>tar xvf sundials-5.1.0.tar.gz 

>mkdir builder 

>cd builder 

>cmake ../../sundials-5.1.0/ -DLAPACK_ENABLE=ON 

>make 

>sudo make install

c) Install scikits odes

add export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/bin to .bashrc 

>source ~/.bashrc 

>sudo pip install scikits.odes


Reference:

https://scikits-odes.readthedocs.io/en/latest/installation.html

Friday, December 4, 2020

Display figure in remote machine

 

import matplotlib matplotlib.use('tkagg') import matplotlib.pyplot as plt plt.plot([1, 2, 3]) plt.show()

ssh -p port_number -X user@xxxx

Reference: https://stackoverflow.com/questions/3453188/matplotlib-display-plot-on-a-remote-machine