Skip to content

Commit

Permalink
Fix plotting bug, release v0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
johnisom committed Dec 13, 2023
1 parent 2cede02 commit c5377f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Install this application:
- `miniconda`: https://docs.conda.io/projects/miniconda/en/latest/miniconda-install.html
- If you already have miniconda or anaconda installed (`conda` is a command in your terminal), skip this step.

Download this repository by heading over to the [latest release](https://github.com/johnisom/wildfire-analyzer/releases/tag/v0.3) and downloading the source code. Unzip it.
Download this repository by heading over to the [latest release](https://github.com/johnisom/wildfire-analyzer/releases/tag/v0.4) and downloading the source code. Unzip it.

Then, open your terminal and navigate to the unzipped repository. In a terminal with miniconda active (`conda` is a useable command), install python package dependencies:
```sh
Expand Down
12 changes: 8 additions & 4 deletions src/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ def plot_counties_by_number_of_fires(counties_geo_df, keys, plot_title):
zero_fire_counts = counties_geo_df[counties_geo_df.fire_count == 0]
more_than_zero_fire_counts = counties_geo_df[counties_geo_df.fire_count > 0]
fig, ax = plt.subplots(figsize=[12, 8])
zero_fire_counts.plot(ax=ax, color='grey', legend=True, aspect=1)
more_than_zero_fire_counts.plot(ax=ax, column='fire_count', legend=True, norm=LogNorm(vmin=more_than_zero_fire_counts.fire_count.min(), vmax=more_than_zero_fire_counts.fire_count.max()))
if len(zero_fire_counts) > 0:
zero_fire_counts.plot(ax=ax, color='grey', legend=True)
if len(more_than_zero_fire_counts) > 0:
more_than_zero_fire_counts.plot(ax=ax, column='fire_count', legend=True, norm=LogNorm(vmin=more_than_zero_fire_counts.fire_count.min(), vmax=more_than_zero_fire_counts.fire_count.max()))
ax.tick_params(axis='both', which='both', bottom=False, left=False, labelbottom=False, labelleft=False)
ax.set_title(plot_title)
fig.supxlabel('(Gray: data not available)')
Expand All @@ -25,8 +27,10 @@ def plot_counties_by_total_area_burned(counties_geo_df, keys, plot_title):
zero_acres_burned = counties_geo_df[counties_geo_df.acres_burned == 0]
more_than_zero_acres_burned = counties_geo_df[counties_geo_df.acres_burned > 0]
fig, ax = plt.subplots(figsize=[12, 8])
zero_acres_burned.plot(ax=ax, color='grey', legend=True, aspect=1)
more_than_zero_acres_burned.plot(ax=ax, column='acres_burned', legend=True, norm=LogNorm(vmin=more_than_zero_acres_burned.acres_burned.min(), vmax=more_than_zero_acres_burned.acres_burned.max()))
if len(zero_acres_burned) > 0:
zero_acres_burned.plot(ax=ax, color='grey', legend=True)
if len(more_than_zero_acres_burned) > 0:
more_than_zero_acres_burned.plot(ax=ax, column='acres_burned', legend=True, norm=LogNorm(vmin=more_than_zero_acres_burned.acres_burned.min(), vmax=more_than_zero_acres_burned.acres_burned.max()))
ax.tick_params(axis='both', which='both', bottom=False, left=False, labelbottom=False, labelleft=False)
ax.set_title(plot_title)
fig.supxlabel('(Gray: data not available)')
Expand Down

0 comments on commit c5377f6

Please sign in to comment.