Skip to content

Commit 4b38ee9

Browse files
committed
changed location of plots for easier view on laptops
1 parent 59e69a3 commit 4b38ee9

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

sunfinder/sunviewer.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,20 @@
2121

2222
def longitudeconverter(longitudes):
2323
if longitudes[-1] == 'W':
24-
longitudes = float('-'+longitudes[0:-1])
24+
if longitudes[0] == '-':
25+
longitudes = float(longitudes[0:-1])
26+
else:
27+
longitudes = float('-'+longitudes[0:-1])
2528
else:
2629
longitudes = float(longitudes[0:-1])
2730
return longitudes
2831

2932
def latitudeconverter(latitudes):
3033
if latitudes[-1] == 'S':
31-
latitudes = float('-'+latitudes[0:-1])
34+
if latitudes[0] == '-':
35+
latitudes = float(latitiudes[0:-1])
36+
else:
37+
latitudes = float('-'+latitudes[0:-1])
3238
else:
3339
latitudes = float(latitudes[0:-1])
3440
return latitudes
@@ -78,7 +84,7 @@ def latitudeconverter(latitudes):
7884
plt.subplot(121)
7985
plt.title(energysysname)
8086
plt.gcf().canvas.set_window_title('ElectriCChain SunViewer v1.0')
81-
plt.subplots_adjust(left=0.06, bottom=0.13, right=0.9, top=0.9)
87+
plt.subplots_adjust(left=0.06, bottom=0.25, right=0.9, top=0.9)
8288
plt.gca().xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d %H:%M:%S'))
8389
plt.gca().xaxis.set_major_locator(mdates.AutoDateLocator())
8490
plt.plot(date, energyplot, 'bo')
@@ -92,14 +98,14 @@ def latitudeconverter(latitudes):
9298
plt.tick_params('y', colors='r')
9399

94100
elif xaxischooser == 'blocks':
95-
plt.figure(num=1, figsize=(16, 12))
101+
plt.figure(num=1, figsize=(10, 8))
96102
thismanager = plt.get_current_fig_manager()
97103
img = PhotoImage(file='elcc_logo.ppm')
98104
thismanager.window.tk.call('wm', 'iconphoto', thismanager.window._w, img)
99105
plt.subplot(121)
100106
plt.title(energysysname)
101107
plt.gcf().canvas.set_window_title('ElectriCChain SunViewer v1.0')
102-
plt.subplots_adjust(left=0.06, bottom=0.13, right=0.98, top=0.9)
108+
plt.subplots_adjust(left=0.06, bottom=0.15, right=0.98, top=0.9)
103109
plt.plot(blocknumber, energyplot, 'bo')
104110
plt.ylabel('TOTAL Energy MWh', color='b')
105111
plt.tick_params('y', colors='b')

0 commit comments

Comments
 (0)