Skip to content

Commit

Permalink
Merge pull request #168 from roseDickinson/patch-1
Browse files Browse the repository at this point in the history
Fix AxesSubplot object has no property nrows error
  • Loading branch information
tomalrussell committed Jul 16, 2019
2 parents 919757a + 578d1b7 commit bc7f5bf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
sudo: false
language: python
virtualenv:
system_site_packages: true
env:
matrix:
- DISTRIB="conda" PYTHON_VERSION="3.5" COVERAGE="true"
Expand Down
23 changes: 8 additions & 15 deletions energy_demand/plotting/basic_plot_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import math
import numpy as np

from scipy.interpolate import interp1d
from scipy.interpolate import spline
from scipy.interpolate import interp1d, splrep, splev

from energy_demand.technologies import diffusion_technologies
#matplotlib.use('Agg') # Used to make it work in linux
Expand Down Expand Up @@ -124,22 +123,16 @@ def smooth_line(
input_y_line_data,
nr_line_points=1000
):
"""https://stackoverflow.com/questions/5283649/plot-smooth-line-with-pyplot
"""https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.splrep.html#scipy.interpolate.splrep
nr_line_points : int
represents number of points to make between input_line_data.min and T.max
"""
input_x_line_data = np.array(input_x_line_data)
input_y_line_data = np.array(input_y_line_data)
x = np.array(input_x_line_data)
y = np.array(input_y_line_data)

smooth_x_line_data = np.linspace(
input_x_line_data.min(),
input_x_line_data.max(),
nr_line_points)
spl = splrep(x, y)
x2 = np.linspace(x.min(), x.max(), nr_line_points)
y2 = splev(x2, spl)

smooth_y_line_data = spline(
input_x_line_data,
input_y_line_data,
smooth_x_line_data)

return smooth_x_line_data, smooth_y_line_data
return x2, y2
2 changes: 1 addition & 1 deletion energy_demand/plotting/fig_load_profile_dh_multiple.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def run(
fig = plt.figure(
figsize=basic_plot_functions.cm2inch(14, 25))

ax = fig.add_subplot(nrows=4, ncols=2)
# ax = fig.add_subplot(nrows=4, ncols=2)

plot_nr = 0
row = -1
Expand Down

0 comments on commit bc7f5bf

Please sign in to comment.