Re: Add scale bar to Image
- To: mathgroup at smc.vnet.net
- Subject: [mg126937] Re: Add scale bar to Image
- From: ccarter at mit.edu
- Date: Mon, 18 Jun 2012 05:47:34 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201206170756.DAA08820@smc.vnet.net>
Hello Slapjack, This should help you get what you want: testimage = Import["ExampleData/rose.gif"] {width, height} = ImageDimensions[testimage] scaledTicks[width_, labeledWidth_, nTicks_] := Module[{baseTicks}, baseTicks = N@FindDivisions[{0, labeledWidth}, nTicks]; Transpose[{width/labeledWidth baseTicks, baseTicks}] ] Show[testimage, Frame -> True, FrameTicks -> { {scaledTicks[height, 10, 2], None}, {scaledTicks[width, 1000, 6], None}}] Craig On Sun, 17 Jun 2012, slapjack0 at gmail.com wrote: > Date: Sun, 17 Jun 2012 03:56:37 -0400 (EDT) > From: slapjack0 at gmail.com > To: mathgroup at smc.vnet.net > Subject: Add scale bar to Image > > Hello, > > I'm looking for a way to add a scale to an image (an imported TIFF file). > I've searched the forums, but many answers are for Graphics (generated plots etc), not Images. > > I have, > photo = Import["example.jpg"] > > If I use, > Show[photo, Frame->True] > the frame is very nice, but is it possible to scale the numbers it uses? (or somehow overlay a axis onto the image?) > > Thanks > >
- References:
- Add scale bar to Image
- From: slapjack0@gmail.com
- Add scale bar to Image