Until such time as @Colorado4Wheeler has time to do something (which I hope happens!), here is a quick and dirty script to generate a calendar plot. The script will place an image into the Indigo Static Images Folder called 'calendar.png' which should make it easy to add to a control page. You can adjust the font and the color by changing the first two variables.
Cautions:
- the font needs to be a monospace font in order for things to line up properly.
- the background is transparent, so choose a color that will work well with your control page background (you can use the OS X color picker to find the HTML color value).
- if you change the font size, it won't be centered in the box any longer (and may not fit if you go much larger); if necessary, uncomment the
'ax.axis('off')' to hide the box.
Note: this script requires matplotlib be installed on the Indigo server machine If your machine does not have matplotlib installed, this is probably not a solution for you (later Macs ship with it preinstalled.)
- Code: Select all
#! /usr/bin/env python2.6
# -*- coding: utf-8 -*-
import calendar
from datetime import datetime, time
import matplotlib.pyplot as plt
font_name = 'Andale Mono'
font_color = '#000000'
year = int(datetime.today().strftime('%Y'))
month = int(datetime.today().strftime('%m'))
cal = calendar.month(year, month)
output_file_path = '/Library/Application Support/Perceptive Automation/Indigo 6/IndigoWebServer/images/controls/static/calendar.png'
fig = plt.figure(figsize=(5, 3))
ax = fig.add_subplot(111)
ax.text(0.07, 0.95, cal, transform=ax.transAxes, color=font_color, fontname=font_name, fontsize=20, verticalalignment='top')
ax.axes.get_xaxis().set_visible(False)
ax.axes.get_yaxis().set_visible(False)
# ax.axis('off') # uncomment this line to hide the box
plt.savefig(output_file_path, transparent=True)
- calendar.png (28.92 KiB) Viewed 4453 times