Skip to content

Commit

Permalink
fix: building completeness figure
Browse files Browse the repository at this point in the history
figure did not display completeness ratio over 100%.
Now figure figure will display completeness ratio up to 150%.
  • Loading branch information
matthiasschaub committed Aug 19, 2022
1 parent e28f9ed commit 154bc66
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- Substitute Simple Report with a Report named Minimal for testing purposes ([#342] [#385])
- Add a minimal Indicator for testing purposes ([#383])
- Remove database scripts ([#392])
- fix: building completeness figure ([#410])

### How to Upgrade

Expand Down Expand Up @@ -65,6 +66,7 @@
[#392]: https://github.com/GIScience/ohsome-quality-analyst/pull/392
[#396]: https://github.com/GIScience/ohsome-quality-analyst/pull/396
[#397]: https://github.com/GIScience/ohsome-quality-analyst/pull/397
[#410]: https://github.com/GIScience/ohsome-quality-analyst/pull/410


## 0.10.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ def create_figure(self) -> None:
ax.yaxis.set_major_formatter(mtick.PercentFormatter(10))
_, _, patches = ax.hist(
[i for i in self.completeness_ratio],
bins=10,
range=(0, 1),
bins=15, # to account for overprediction (>100% completeness)
range=(0, 1.5),
density=True,
weights=self.building_area_prediction,
edgecolor="black",
Expand All @@ -197,7 +197,7 @@ def create_figure(self) -> None:
)
ax.legend(loc="lower center", bbox_to_anchor=(0.5, -0.45))
# has to be executed after "major formatter setting"
plt.xlim(0, 1)
plt.xlim(0, 1.5)
plt.ylim(0, 10)
img_data = StringIO()
plt.savefig(img_data, format="svg", bbox_inches="tight")
Expand Down

0 comments on commit 154bc66

Please sign in to comment.