Skip to content

Commit

Permalink
Replaced origin='image' with origin='lower' in PPPlot.py (#174)
Browse files Browse the repository at this point in the history
* Replaced origin='image' with origin='lower' in PPPlot.py

Replaced the incorrect keyword argument 'image' with 'lower' in PPPlot.py

I remember these were mostly fixed a while ago but seems that some were left behind.

* Same fix in three other files
LauriKurki authored Jun 14, 2023
1 parent c5286ad commit e12f67e
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ppafm/GUIWidgets.py
Original file line number Diff line number Diff line change
@@ -161,7 +161,7 @@ def plotSlice2(self, F_stack, title=None , margins=None, grid_selector = 0, slic
print('self.margins', margins)
if alpha>0 and big_len_image is not None:
F = F*(1-alpha) + big_len_image*alpha
self.img = self.axes.imshow( F, origin='image', cmap='viridis', interpolation='bicubic' )
self.img = self.axes.imshow( F, origin='lower', cmap='viridis', interpolation='bicubic' )

j_min,i_min = np.unravel_index(F.argmin(), F.shape)
j_max,i_max = np.unravel_index(F.argmax(), F.shape)
6 changes: 3 additions & 3 deletions ppafm/PPPlot.py
Original file line number Diff line number Diff line change
@@ -89,7 +89,7 @@ def plotVecFieldRG(
print(" plotting ", i)
plt.figure( figsize=( 10,10 ) )
HSBs,vmax = colorize_XY2RG(dXs[i],dYs[i])
plt.imshow( HSBs, extent=extent, origin='image', interpolation=interpolation )
plt.imshow( HSBs, extent=extent, origin='lower', interpolation=interpolation )
plotGeom( atoms, bonds, atomSize=atomSize )
plt.xlabel(r' Tip_x $\AA$')
plt.ylabel(r' Tip_y $\AA$')
@@ -111,7 +111,7 @@ def plotDistortions(
plt.figure( figsize=figsize )
plt.plot ( X[i,::by,::by].flat, Y[i,::by,::by].flat, 'r.', markersize=markersize )
if BG is not None:
plt.imshow( BG[i,:,:], origin='image', interpolation=interpolation, cmap=cmap, extent=extent, vmin=vmin, vmax=vmax )
plt.imshow( BG[i,:,:], origin='lower', interpolation=interpolation, cmap=cmap, extent=extent, vmin=vmin, vmax=vmax )
if cbar:
plt.colorbar()
plotGeom( atoms, bonds, atomSize=atomSize )
@@ -136,7 +136,7 @@ def plotArrows(
plt.figure( figsize=figsize )
plt.quiver( Xs[::by,::by], Ys[::by,::by], dX[::by,::by], dY[::by,::by], color = 'k', headlength=10, headwidth=10, scale=15 )
if BG is not None:
plt.imshow ( BG[i,:,:], origin='image', interpolation=interpolation, cmap=cmap, extent=extent, vmin=vmin, vmax=vmax )
plt.imshow ( BG[i,:,:], origin='lower', interpolation=interpolation, cmap=cmap, extent=extent, vmin=vmin, vmax=vmax )
if cbar:
plt.colorbar()
plotGeom( atoms, bonds, atomSize=atomSize )
2 changes: 1 addition & 1 deletion ppafm/cli/gui/ExpShifter.py
Original file line number Diff line number Diff line change
@@ -468,7 +468,7 @@ def saveImg(self):
for i in range(n):
print (i)
plt.subplot(1,n,i+1)
plt.imshow(self.data[i], origin='image') #,cmap='gray')
plt.imshow(self.data[i], origin='lower') #,cmap='gray')
print ('image path = ' , self.path+'data.png')
plt.savefig(self.path+"data.png", bbox_inches='tight')

2 changes: 1 addition & 1 deletion ppafm/cli/gui/ExpShifter_2tips.py
Original file line number Diff line number Diff line change
@@ -565,7 +565,7 @@ def saveImg(self):
for i in range(n):
print (i)
plt.subplot(1,n,i+1)
plt.imshow(self.data[i], origin='image') #,cmap='gray')
plt.imshow(self.data[i], origin='lower') #,cmap='gray')
print ('image path = ' , self.path+'data.png')
plt.savefig(self.path+"data.png", bbox_inches='tight')

0 comments on commit e12f67e

Please sign in to comment.