Last active
July 24, 2017 00:13
-
-
Save arunreddy/a26072b68fbb68ead7b9b5bd6a4e5ad4 to your computer and use it in GitHub Desktop.
RTD_ZONAL_LBMP.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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