Skip to content

Instantly share code, notes, and snippets.

@arunreddy
Last active July 24, 2017 00:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arunreddy/a26072b68fbb68ead7b9b5bd6a4e5ad4 to your computer and use it in GitHub Desktop.
Save arunreddy/a26072b68fbb68ead7b9b5bd6a4e5ad4 to your computer and use it in GitHub Desktop.
RTD_ZONAL_LBMP.py
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from matplotlib.dates import DateFormatter, MinuteLocator, MonthLocator
def datetime(x):
return np.array(x, dtype = np.datetime64)
if __name__ == '__main__':
# Save the file as a .csv file from your excel.
file_name = 'RTC_RTD_LBMP_NYCA.csv'
# Read the file into the code.
df = pd.read_csv(file_name, parse_dates = ['BINDING_TIMESTAMP'])
plt.figure(figsize=(30,5))
# Plot 01
plt.plot(datetime(df['BINDING_TIMESTAMP']),df['RTD_ZONAL_LBMP'], label = 'RTD_LBMP', c = 'red')
# Plot 02
plt.plot(datetime(df['BINDING_TIMESTAMP']),df['RTC_zonal_LBMP'], label = 'RTC_LBMP', c = 'blue')
plt.title("NYCA Zone")
plt.xlabel('Binding Timestamp')
plt.legend()
plt.grid()
#
start = df['BINDING_TIMESTAMP'].min()
end = df['BINDING_TIMESTAMP'].max()
plt.xlim(start,end)
date_formatter = '%b %y'
xfmt = DateFormatter(date_formatter)
ax = plt.gca()
ax.xaxis.set_major_locator(MonthLocator())
ax.xaxis.set_major_formatter(xfmt)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment