Skip to content

Commit

Permalink
Higher dpi for save
Browse files Browse the repository at this point in the history
  • Loading branch information
Phlya committed May 26, 2018
1 parent b65a844 commit 72a5966
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Documentation Status](https://readthedocs.org/projects/adjusttext/badge/?version=latest)](http://adjusttext.readthedocs.io/en/latest/?badge=latest) [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/adjustText/Lobby)

Inspired by **ggrepel** package for R/ggplot2 (https://github.com/slowkow/ggrepel)
![Alt text](examples/mtcars.gif "Labelled mtcars dataset")
![Alt text](figures/mtcars.gif "Labelled mtcars dataset")

The idea is that often when we want to label multiple points on a graph the text will start heavily overlapping with both other labels and data points. This can be a major problem requiring manual solution. However this can be largely automatized by smart placing of the labels (difficult) or iterative adjustment of their positions to minimize overlaps (relatively easy). This library (well... script) implements the latter option to help with matplotlib graphs. Usage is very straightforward with usually pretty good results with no tweaking (most important is to just make text slightly smaller than default and maybe the figure a little larger). However the algorithm itself is highly configurable for complicated plots.

Expand Down
8 changes: 4 additions & 4 deletions adjustText/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ def adjust_text(texts, x=None, y=None, add_objects=None, ax=None,
if add_step_numbers:
plt.title('Before')
plt.savefig('%s%s.%s' % (save_prefix,
'000a', save_format), format=save_format)
'000a', save_format), format=save_format, dpi=150)
elif on_basemap:
ax.draw(r)

Expand All @@ -489,7 +489,7 @@ def adjust_text(texts, x=None, y=None, add_objects=None, ax=None,
if add_step_numbers:
plt.title('Autoaligned')
plt.savefig('%s%s.%s' % (save_prefix,
'000b', save_format), format=save_format)
'000b', save_format), format=save_format, dpi=150)
elif on_basemap:
ax.draw(r)

Expand Down Expand Up @@ -554,7 +554,7 @@ def adjust_text(texts, x=None, y=None, add_objects=None, ax=None,
plt.title(i+1)
plt.savefig('%s%s.%s' % (save_prefix,
'{0:03}'.format(i+1), save_format),
format=save_format)
format=save_format, dpi=150)
elif on_basemap:
ax.draw(r)
# Stop if we've reached the precision threshold, or if the x and y displacement
Expand All @@ -574,7 +574,7 @@ def adjust_text(texts, x=None, y=None, add_objects=None, ax=None,
plt.title(i+1)
plt.savefig('%s%s.%s' % (save_prefix,
'{0:03}'.format(i+1), save_format),
format=save_format)
format=save_format, dpi=150)
elif on_basemap:
ax.draw(r)

Expand Down

0 comments on commit 72a5966

Please sign in to comment.