## Re: [Matplotlib-users] Plotting points on images - axes problems

 Re: [Matplotlib-users] Plotting points on images - axes problems From: John Hunter - 2006-05-04 14:48:52 ```>>>>> "Eric" == Eric Firing writes: Eric> Bob, Try doing Eric> b = axis() ax1.plot([0.0],[0.0],'wo') axis(b) Eric> That saves the axis range set by imshow and restores it Eric> after the call to plot. You can also turn on an off autoscaling ax.set_autoscale_on(False) JDH ```

 [Matplotlib-users] Plotting points on images - axes problems From: Robert Simpson - 2006-05-03 15:29:44 ```Hi, Using matplotlib 0.87.2, I've been trying to plot points on top of an image. The image without points fills axes of the extent requested, but using plot to add a point on top of the image changes the axes lengths and gives unwanted white margins around the edges. Here's an example. Any help would be greatly appreciated! Bob Simpson from pylab import * # Sample image. image = rand(12,6) # This choice for extent works fine... It produces no white margins. #extent = [-80, 60, -60, 40] # This choice gives unwanted white margins, # except when no point is plotted. extent = [-80.,64., -74.,48.] ax1 = axes() ax1.im = imshow(image, origin='lower', extent=extent) # Plot point on image. hold(True) ax1.plot([0.0],[0.0],'wo') show() ```
 Re: [Matplotlib-users] Plotting points on images - axes problems From: Eric Firing - 2006-05-03 16:53:34 ```Bob, Try doing b = axis() ax1.plot([0.0],[0.0],'wo') axis(b) That saves the axis range set by imshow and restores it after the call to plot. Eric Robert Simpson wrote: > Hi, > > Using matplotlib 0.87.2, I've been trying to plot points on top of an > image. The image without points fills axes of the extent requested, but > using plot to add a point on top of the image changes the axes lengths > and gives unwanted white margins around the edges. Here's an example. > Any help would be greatly appreciated! > > Bob Simpson > > from pylab import * > > # Sample image. > image = rand(12,6) > > # This choice for extent works fine... It produces no white margins. > #extent = [-80, 60, -60, 40] > > # This choice gives unwanted white margins, > # except when no point is plotted. > extent = [-80.,64., -74.,48.] > > ax1 = axes() > ax1.im = imshow(image, origin='lower', extent=extent) > > # Plot point on image. > hold(True) > ax1.plot([0.0],[0.0],'wo') > > show() > > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ```
 Re: [Matplotlib-users] Plotting points on images - axes problems From: John Hunter - 2006-05-04 14:48:52 ```>>>>> "Eric" == Eric Firing writes: Eric> Bob, Try doing Eric> b = axis() ax1.plot([0.0],[0.0],'wo') axis(b) Eric> That saves the axis range set by imshow and restores it Eric> after the call to plot. You can also turn on an off autoscaling ax.set_autoscale_on(False) JDH ```