-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathScatter_plot.py
More file actions
executable file
·30 lines (23 loc) · 990 Bytes
/
Scatter_plot.py
File metadata and controls
executable file
·30 lines (23 loc) · 990 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 30 16:43:01 2019
@author: SumeetKumar
"""
import matplotlib.pyplot as plt
def scatter_plot(Fig,Ax,Xdata,Ydata,color,Labl,Baseline_rotor_power):
Sc=Ax.scatter(Xdata, Ydata, c=color, label=Labl, alpha=0.65) #alpha=1.0 for opaque points
Ax.legend(loc='center left', bbox_to_anchor=(1, 0.5))
Ax.set_xlabel(r'ALL FILES $\longrightarrow$',fontweight='bold')
Ax.set_ylabel('ROTOR POWER (HP)',fontweight='bold')
#Adding horizontal line corresponding to Baseline
Ax.axhline(y=Baseline_rotor_power, color='k', linestyle='--', linewidth=2.0)
plt.show()
return Sc
def save_this_subplot_as_fig(Fig_name,Xdata,Ydata,Labl,color,Dir):
Fig=plt.figure()
Ax=Fig.add_subplot(1,1,1)
Ax.scatter(Xdata, Ydata, c=color, label=Labl, alpha=0.65) #alpha=1.0 for opaque points
Fig.savefig(Dir+'/'+Fig_name+'.png')
print('saved: ', Fig_name)
plt.close(Fig)