Added gridlines to graph
This commit is contained in:
parent
a4aaa134bb
commit
03fc4cadff
2 changed files with 8 additions and 1 deletions
|
@ -75,6 +75,7 @@ def level_from_to(start: str, stop: str) -> str:
|
||||||
plt.ylabel("Carbon Intensity [gCO2/kWh]")
|
plt.ylabel("Carbon Intensity [gCO2/kWh]")
|
||||||
plt.xticks(rotation=45)
|
plt.xticks(rotation=45)
|
||||||
plt.gcf().subplots_adjust(bottom=0.2)
|
plt.gcf().subplots_adjust(bottom=0.2)
|
||||||
|
plt.grid(b=True)
|
||||||
plt.savefig("plot.png")
|
plt.savefig("plot.png")
|
||||||
plt.clf()
|
plt.clf()
|
||||||
return "plot.png"
|
return "plot.png"
|
|
@ -1,9 +1,14 @@
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
|
import re
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
class Logger(commands.Cog):
|
class Logger(commands.Cog):
|
||||||
def __init__(self, client):
|
def __init__(self, client):
|
||||||
self.client = client
|
self.client = client
|
||||||
|
self.first = True
|
||||||
|
self.last_update = datetime.now()
|
||||||
|
self.most_common = []
|
||||||
|
|
||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_message(self, message):
|
async def on_message(self, message):
|
||||||
|
@ -18,6 +23,7 @@ class Logger(commands.Cog):
|
||||||
|
|
||||||
with open('data/naughty_step.txt', 'a') as file:
|
with open('data/naughty_step.txt', 'a') as file:
|
||||||
file.write(message.content + '\n')
|
file.write(message.content + '\n')
|
||||||
|
|
||||||
|
|
||||||
def setup(client):
|
def setup(client):
|
||||||
client.add_cog(Logger(client))
|
client.add_cog(Logger(client))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue