-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmyplotlib.py
More file actions
61 lines (53 loc) · 1.31 KB
/
myplotlib.py
File metadata and controls
61 lines (53 loc) · 1.31 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
marker_index = 0
marker_list = [ "o", "x", "s", "+", "v", "h", "^", "d" ]
color_index = 0
# my gnuplot color
color_list = [ "#009e73",
"#56b4e9",
"#707070",
"#e54e40",
"#0072b2",
"#e69f00",
"#000000",
"#1a1a1a" ,
]
# tab10
color_list = [ "#3c76af",
"#ee8536",
"#539d3e",
"#c43a32",
"#8d6ab8",
"#84584e",
"#d47ebf",
"#7f7f7f",
"#bcbc45",
"#5abbcc",
]
line_index = 0
line_list = [
"-", "--", "-.", ":"
]
def get_marker():
global marker_index
global maker_list
m = marker_list[marker_index]
marker_index = (marker_index + 1) % len(marker_list)
return m
def get_color():
global color_index
global color_list
c = color_list[color_index]
color_index = (color_index + 1) % len(color_list)
return c
def get_linestyle():
global line_index
global line_list
l = line_list[line_index]
line_index = (line_index + 1) % len(line_list)
return l
def change_aspect_ratio(p, ratio):
aspect = ((1/ratio) *
(p.get_xlim()[1] - p.get_xlim()[0]) /
(p.get_ylim()[1] - p.get_ylim()[0]))
p.set_aspect(aspect)
return