-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgeneric_plot_functions.py
More file actions
31 lines (28 loc) · 1.1 KB
/
Copy pathgeneric_plot_functions.py
File metadata and controls
31 lines (28 loc) · 1.1 KB
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
30
31
############################################################################################
## common plotting functions that might be used in several different notebooks or figures ##
############################################################################################
import numpy as np
def plotMap(ax,myMap,title="",titleY=0.95,titleFontSize=10,transpose=True,cmap="jet",vmin=0,alpha=1):
"""
Plot one 2D map
"""
if transpose:
ax.imshow(myMap.T,origin="lower",cmap=cmap,interpolation=None, vmin=vmin,alpha=alpha)
else:
ax.imshow(myMap,origin="lower",cmap=cmap,interpolation=None, vmin=vmin,alpha=alpha)
ax.set_title(title,y=titleY,fontsize=titleFontSize)
ax.set_aspect('equal', adjustable='box')
ax.axis('off')
def plotHDHist(ax,oneHist,bins,title=""):
"""
Plot one polar histogram
"""
ownBins = bins.copy()
ownHist = oneHist.copy()
ownBins = np.append(ownBins,ownBins[0])
ownHist = np.append(ownHist,ownHist[0])
ax.plot(ownBins,
ownHist)
ax.set_xticklabels([])
ax.set_title(title,y=0.98)
ax.grid(True)