Skip to content

Commit

Permalink
Notebook cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
hpparvi committed Feb 5, 2024
1 parent 4fd13ba commit d58aac9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions notebooks/roadrunner/common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from numpy import *
from numpy.random import normal, uniform

from matplotlib import rc
from matplotlib.pyplot import subplots, setp
rc('figure', figsize=(13,5))

def plot_lc(time, flux, c=None, ylim=(0.9865, 1.0025), ax=None, figsize=None):
if ax is None:
fig, ax = subplots(figsize=figsize)
else:
fig, ax = None, ax
ax.plot(time, flux, c=c)
ax.autoscale(axis='x', tight=True)
setp(ax, xlabel='Time [d]', ylabel='Flux', xlim=time[[0, -1]], ylim=ylim)

if fig is not None:
fig.tight_layout()
return ax

0 comments on commit d58aac9

Please sign in to comment.