Sep-20-2021, 06:13 PM
Hi all,
Here's some code:
Mark
Here's some code:
import pandas as pd
import matplotlib.pyplot as plt
import time
import numpy as np
start_time = time.time()
df = pd.DataFrame(columns=['DTE', 'Long Delta', 'Short Delta', 'Delta Spread'])
# Checking all permutations covered by program:
for dte in range(30,61):
long_delta = np.arange(-0.1,-0.35,-0.05)
short_delta = np.arange(-0.25,-0.50,-0.05)
if dte == 30:
for ld in long_delta:
for sd in short_delta:
plt.scatter(ld,sd)
plt.tight_layout() #to prevent axis labels from being cut off in saved figure
plt.xlabel('Long Delta')
plt.ylabel('Short Delta')
end_time = time.time()
print('Elapsed time is {:.0f}ms'.format(1000*(end_time-start_time)))How do I reverse the axes on the graph so they go from largest to smallest (left to right and down to up)?Mark
