-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrun_demo.py
More file actions
82 lines (74 loc) · 2.6 KB
/
run_demo.py
File metadata and controls
82 lines (74 loc) · 2.6 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import os
from create_citation_map import create_citation_map
# --- 1. Configuration ---
CSV_FILENAME = "citation_info.csv"
# --- 2. Run Map Examples ---
if not os.path.exists(CSV_FILENAME):
print(f"Error: '{CSV_FILENAME}' not found.")
else:
print(f"Loading data from '{CSV_FILENAME}' to generate maps...")
# --- Example: Simple Mode (Green) with Scaled Pins ---
print("Running Example: Simple Green with Pins...")
create_citation_map(
CSV_FILENAME,
output_filename='figs/map_ex_simple_green_with_pin.png',
scale='log_rank', # Use rank scale for pins
fill_mode='simple',
fill_alpha=0.7,
fill_color='#B5E48C', # Light green fill
show_pins=True,
pin_cmap='YlGn', # Use a green heatmap for pins
pin_scale_color=True, # Scale pin color
pin_scale_size=True, # Scale pin size
pin_scale_alpha=False, # Use static alpha for pins
pin_size_range=(30, 250),
show_legend=True,
)
# --- Example 1: Simple Mode (Blue) ---
print("Running Example 1: Simple Blue...")
create_citation_map(
CSV_FILENAME,
output_filename='figs/map_ex1_simple_blue.png',
fill_mode='simple',
fill_color='#0077B6', # Use a blue fill
show_legend=True,
)
# --- Example 2: Heatmap Mode (Red) with Pins ---
print("Running Example 2: Heatmap with Red Pins...")
create_citation_map(
CSV_FILENAME,
output_filename='figs/map_ex2_heatmap_with_Reds_cmap_with_pin.png',
scale='log_rank',
fill_mode='heatmap',
fill_cmap='Reds',
show_pins=True,
pin_color='#333333', # Dark grey pins
pin_scale_alpha=False, # Use Static alpha
show_legend=True,
)
# --- Example 3: Heatmap Mode (Blue) with Labels ---
print("Running Example 3: Heatmap with Labels...")
create_citation_map(
CSV_FILENAME,
output_filename='figs/map_ex3_heatmap_with_label.png',
scale='log_rank',
fill_mode='heatmap',
fill_cmap='Blues',
show_labels=True,
show_legend=True,
adjust_labels=True,
)
# --- Example 4: Heatmap Mode (Blue) with Labels & Counts ---
print("Running Example 4: Heatmap with Labels & Counts...")
create_citation_map(
CSV_FILENAME,
output_filename='figs/map_ex4_heatmap_with_label_count.png',
scale='log_rank',
fill_mode='heatmap',
fill_cmap='Blues',
show_labels=True,
show_legend=True,
show_counts=True,
adjust_labels=True,
)
print("\nAll map examples generated!")