How to make figure rectangle in Matplotlib -


i have drawn following figure. possible make figure length 2 unit & height 1 unit? possible change plt.xlabel('time (s)') plt.xlabel('$\alpha \rightarrow$')?

import matplotlib.pyplot plt import numpy np  t=[0,1,2] s=[0.05,0.1,0.2]   plt.plot(t, s)  plt.xlabel('time (s)') plt.ylabel('voltage (mv)') #plt.title('about simple gets, folks') plt.grid(true) plt.savefig("test.png") plt.show() 

you answered own question figure size.

for second question need raw string, e.g.: plt.xlabel(r'$\alpha \rightarrow$')

to make alpha bold -- requested in comment -- it's little more involved. per https://tex.stackexchange.com/a/99286 you'd do:

import matplotlib  matplotlib.rc('text', usetex=true) matplotlib.rcparams['text.latex.preamble']=[r"\usepackage{amsbsy}"]  t=[0,1,2] s=[0.05,0.1,0.2] plt.plot(t, s) plt.ylabel('voltage (mv)') plt.xlabel(r'$\pmb{\alpha}$ \rightarrow$') plt.show() 

Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -