Пример #1
0
# imports
import sys, os
sys.path.append(os.path.abspath('../shared'))
import my_module as mymod
from importlib import reload
reload(mymod)

import requests
import bs4
import xml.etree.ElementTree as ET
import pandas as pd
from datetime import datetime
import matplotlib.pyplot as plt

# make sure the output directory exists
junk, out_dir = mymod.get_outdir()
mymod.make_dir(out_dir)

plt.close('all')

do_ndbc = True
do_tide = True

if do_ndbc:
    # EXAMPLE 1: NDBC buoy data - historical for one year

    # Resources
    # https://www.ndbc.noaa.gov/
    # https://www.ndbc.noaa.gov/download_data.php?filename=46029h2018.txt.gz&dir=data/historical/stdmet/

    # station and year
Пример #2
0
"""
Plotting tips focused on fontsize, linewidth, and markers.

"""

# imports
import sys, os
import numpy as np
import matplotlib.pyplot as plt

# local imports
sys.path.append(os.path.abspath('../shared'))
import my_module as mymod
this_parent, out_dir = mymod.get_outdir()
mymod.make_dir(out_dir) 

# make some lines to plot
xs = np.linspace(0, 10, 500) # smooth line
ys = np.sin(xs**1.5)
xp = np.linspace(.2,9.8, 20) # discrete points
yp = np.sin(xp**1.5) + .1 * np.random.randn(len(xp))
# axis limits
x0 = xs[0]; x1 = xs[-1]
y0 = -1.5; y1 = 1.5

# PLOTTING
fs = 18 # primary fontsize
lw = 3 # primary linewidth
plt.close('all')

# ----------------------------------------------------------------------