Skip to content

Commit

Permalink
fix annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipDominec committed May 28, 2015
1 parent abc1a35 commit 6fb41c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ For more physical background, see the excellent book *Photonic Crystals: Molding
## Requirements
* unix-like environment with a bash-like shell
* mpb
* python-numpy
* python-scipy
* python-matplotlib
* (imagemagick)

Expand Down
10 changes: 1 addition & 9 deletions plot_dispersion_and_modes.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,8 @@ def plot_mode(file1, file2, file3, title='', plot_vectors=True):#{{{
freqs_XUptoM = freqs[:,-1]
plt.plot(Ky+.5, freqs_XUptoM*fcoef/funit, label=u"band #$%d$"%(plotband-1), ls='-', lw=2, c='#888888')


## Static annotation of the horizontal K-axis
bbox=dict(boxstyle='round, pad=.15', fc='white', alpha=0.5)
arrowprops = dict(arrowstyle = '->', connectionstyle = 'arc3,rad=0')
plt.annotate("$\Gamma$", xy = (.001, .001), xytext = (10, 10), textcoords='offset points', ha='right', va='bottom', bbox=bbox, arrowprops=arrowprops)
plt.annotate("X", xy = (.499,.001), xytext = (-10, 10), textcoords='offset points', ha='right', va='bottom', bbox=bbox, arrowprops=arrowprops)
plt.annotate("M", xy = (.499+.5,.001), xytext = (-10, 10), textcoords='offset points', ha='right', va='bottom', bbox=bbox, arrowprops=arrowprops)

## Floating annotation of the points at the dispersion curves
bbox_args = dict(boxstyle="round, pad=.1", fc='w', ec='w', color='#ffffff', alpha=1)
bbox_args = dict(boxstyle="round, pad=.1", fc='w', ec='w', color='#ffffff', alpha=.7)
arrow_args = dict(arrowstyle="->", color='r', lw=1, alpha=1)
plt.annotate('$\Gamma%d$'%plotband, xy=((1./columncount-.02), (plotband - .5)/bandnumber), xycoords='figure fraction',
xytext=(-.05, freqs_GammaUptoX[0]*3), textcoords='data',
Expand Down

0 comments on commit 6fb41c1

Please sign in to comment.