Grefer / MelonsComment

BlogsComment
0 stars 0 forks source link

关于损失厌恶 #85

Open Grefer opened 4 years ago

Grefer commented 4 years ago

https://www.melonsblog.cn/2020/05/blog-post_26.htmlm=1#more

Grefer commented 4 years ago

-- coding: utf-8 --

""" Grefer

This is a temporary script file. """

import matplotlib.pyplot as plt import numpy as np

x = np.linspace(-1, 3, 50) # 从-1到3,等分50份 y = np.log10(x+1) # 函数的表达式

plt.figure() # 定义一个图像窗口 plt.plot(x, y) # 绘制曲线 y plt.xlabel('Yield') #Yield=P&L/Capital plt.ylabel('Utility')

ax = plt.gca() ax.xaxis.set_ticks_position('bottom') ax.yaxis.set_ticks_position('left') ax.spines['right'].set_color('none') ax.spines['top'].set_color('none')

ax.xaxis.set_ticks_position('bottom') ax.yaxis.set_ticks_position('left')

ax.spines['bottom'].set_position(('data', 0)) ax.spines['left'].set_position(('data', 0))

plt.show()