Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions corporate-travel/main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
from collections import OrderedDict
import matplotlib.pyplot as plt
from operator import itemgetter
from pathlib import Path
import requests
import re
import sys

sys.path.append(str(Path(__file__).resolve().parents[1]))
from watermark import add_watermark
# from https://www.businesstravelnews.com/Corporate-Travel-100/2018

s = """Deloitte
Expand Down Expand Up @@ -119,4 +124,5 @@
plt.xlabel('$M')
plt.title('2017 U.S.-Booked Air Volume')
plt.gca().get_xaxis().get_major_formatter().set_scientific(False)
add_watermark()
plt.show()
6 changes: 6 additions & 0 deletions food/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import matplotlib.pyplot as plt
from pathlib import Path
import sys

sys.path.append(str(Path(__file__).resolve().parents[1]))
from watermark import add_watermark

fruit = {
'banana': [.45, 7, '🍌'],
Expand Down Expand Up @@ -51,4 +56,5 @@
plt.legend([plt.plot([], [], 'o')[0], plt.plot([], [], 'oC2')[0]],
['Fruit', 'Vegetable'],
labelcolor="markerfacecolor")
add_watermark()
plt.show()
6 changes: 6 additions & 0 deletions pay/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import matplotlib.pyplot as plt
from pathlib import Path
import sys

sys.path.append(str(Path(__file__).resolve().parents[1]))
from watermark import add_watermark

map = {
'Amazon': [4836, 164, 3.8],
Expand Down Expand Up @@ -79,4 +84,5 @@
plt.legend([plt.plot([], [], 'o')[0] for i in range(3)],
['West coast', 'Rest of USA', 'Rest of World'],
labelcolor=['C0', 'C1', 'C2'])
add_watermark()
plt.show()
6 changes: 6 additions & 0 deletions store-sales/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
from collections import OrderedDict
import matplotlib.pyplot as plt
from operator import itemgetter
from pathlib import Path
import sys

sys.path.append(str(Path(__file__).resolve().parents[1]))
from watermark import add_watermark
# from https://stores.org/stores-top-retailers-2018/

s = """Walmart $374.80 Bentonville, Ark. 5,328
Expand Down Expand Up @@ -114,4 +119,5 @@
plt.xlabel('$')
plt.title('Annual Sales per Store')
plt.gca().get_xaxis().get_major_formatter().set_scientific(False)
add_watermark()
plt.show()
14 changes: 14 additions & 0 deletions watermark.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import matplotlib.pyplot as plt


def add_watermark(text="github.com/PatMyron/data"):
plt.gcf().text(
0.99,
0.01,
text,
ha="right",
va="bottom",
fontsize=8,
color="0.35",
alpha=0.5,
)