import math
import pylab

fig_width_pt = 246.0  # Get this from LaTeX using \showthe\columnwidth
inches_per_pt = 1.0/72.27               # Convert pt to inch
golden_mean = (math.sqrt(5)-1.0)/2.0         # Aesthetic ratio
fig_width = fig_width_pt * inches_per_pt  # width in inches
fig_height = fig_width * golden_mean    # height in inches
fig_size = [fig_width, fig_height]
params = {'backend': 'ps',
          'axes.labelsize': 10,
          'text.fontsize': 10,
          'legend.fontsize': 10,
          'xtick.labelsize': 8,
          'ytick.labelsize': 8,
          'text.usetex': True,
          'figure.figsize': fig_size}
pylab.rcParams.update(params)

z = pylab.arange(0, 200)

def v(z):
    if z <= 0.05:
        return 0
    return 0.19 * ((z / 0.05)**0.07) * math.log(z / 0.05) * 25

# Plot data
pylab.figure(1)
pylab.clf()
# pylab.axes([0.125, 0.2, 0.95-0.125, 0.95-0.2])
pylab.plot(z, list(map(v, z)), color='gray')
pylab.ylabel('$v_m [ms^{-2}]$')
pylab.xlabel('$z [m]$')
pylab.grid()
pylab.subplots_adjust(bottom=0.15)
# pylab.legend()
pylab.savefig('images/fig_rychlost_vetru.pdf')
