Skip to content

Commit

Permalink
Merge pull request #77 from jrleeman/pythonic_update
Browse files Browse the repository at this point in the history
Add fix for plotting with new pandas/matplotlib issue
  • Loading branch information
dopplershift committed Feb 17, 2020
2 parents 0011bdf + ec3887e commit 19f7cf2
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"fig, (ax1, ax2) = plt.subplots(1, 2, sharex=True, figsize=(18, 6))\n",
"\n",
"# Panel 1\n",
"ax1.plot(df.time, df.wind_speed, color='tab:orange', label='Windspeed')\n",
"ax1.plot(df.time.values, df.wind_speed, color='tab:orange', label='Windspeed')\n",
"ax1.set_xlabel('Time')\n",
"ax1.set_ylabel('Speed')\n",
"ax1.set_title('Measured Winds')\n",
Expand All @@ -115,7 +115,7 @@
"ax1.xaxis.set_major_locator(DayLocator())\n",
"\n",
"# Panel 2\n",
"ax2.plot(df.time, df.pressure, color='black', label='Pressure')\n",
"ax2.plot(df.time.values, df.pressure, color='black', label='Pressure')\n",
"ax2.set_xlabel('Time')\n",
"ax2.set_ylabel('hPa')\n",
"ax2.set_title('Atmospheric Pressure')\n",
Expand Down Expand Up @@ -587,7 +587,7 @@
"# Loop over the list of subplots and names together\n",
"for ax, var_name in zip(axes, plot_variables):\n",
" \n",
" ax.plot(df.time, df[var_name])\n",
" ax.plot(df.time.values, df[var_name])\n",
"\n",
" # Set label/title based on variable name--no longer hard-coded\n",
" ax.set_ylabel(var_name)\n",
Expand Down Expand Up @@ -653,7 +653,7 @@
"\n",
" # Grab the color from our dictionary and pass it to plot()\n",
" color = colors[var_name]\n",
" ax.plot(df.time, df[var_name], color)\n",
" ax.plot(df.time.values, df[var_name], color)\n",
"\n",
" ax.set_ylabel(var_name)\n",
" ax.set_title(f'Buoy {var_name}')\n",
Expand Down Expand Up @@ -686,7 +686,7 @@
" for var_name in var_names:\n",
" # Grab the color from our dictionary and pass it to plot()\n",
" color = colors[var_name]\n",
" ax.plot(df.time, df[var_name], color)\n",
" ax.plot(df.time.values, df[var_name], color)\n",
"\n",
" ax.set_ylabel(var_name)\n",
" ax.set_title(f'Buoy {var_name}')\n",
Expand Down Expand Up @@ -725,7 +725,7 @@
" for var_name in var_names:\n",
" # Grab the color from our dictionary and pass it to plot()\n",
" color = colors[var_name]\n",
" ax.plot(df.time, df[var_name], color)\n",
" ax.plot(df.time.values, df[var_name], color)\n",
"\n",
" ax.set_ylabel(var_name)\n",
" ax.set_title(f'Buoy {var_name}')\n",
Expand Down Expand Up @@ -791,7 +791,7 @@
" \n",
" color = colors[var_name]\n",
" linestyle = linestyles[var_name]\n",
" ax.plot(df.time, df[var_name], color, linestyle=linestyle, label=label)\n",
" ax.plot(df.time.values, df[var_name], color, linestyle=linestyle, label=label)\n",
"\n",
" ax.set_ylabel(title)\n",
" ax.set_title(f'Buoy {title}')\n",
Expand Down Expand Up @@ -840,7 +840,7 @@
" title, label = format_varname(var_name)\n",
" color = colors[var_name]\n",
" linestyle = linestyles[var_name]\n",
" ax.plot(df.time, df[var_name], color, linestyle=linestyle, label=label)\n",
" ax.plot(df.time.values, df[var_name], color, linestyle=linestyle, label=label)\n",
"\n",
" ax.set_ylabel(title)\n",
" ax.set_title(f'Buoy {buoy} {title}')\n",
Expand Down

0 comments on commit 19f7cf2

Please sign in to comment.