Prev: Physics
Next: illumina solexa sequencing
From: Michael Coughlin on 13 May 2010 15:35 Hi, So this should be simple for someone to answer, I have looked through the information on axes and not quite found what I am looking for. I produce a plot with imagesc, which works well. So let us imagine that my x and y values go from 0 to 100. On the x and y axes then, it says that they go from 0 to 100, which makes perfect sense. How do I make it such that the x axes label says it goes from say 0 to 200 (even though it does not) and maybe the y label says it goes from -50 to 50. Does that make sense? Thank you, Michael
From: ImageAnalyst on 13 May 2010 15:54 Michael Coughlin Look up ticks in the help and you'll find info, plus this example: x = -pi:.1:pi; y = sin(x); plot(x,y) set(gca,'XTick',-pi:pi/2:pi) set(gca,'XTickLabel',{'-pi','-pi/2','0','pi/2','pi'})
From: Alan B on 13 May 2010 16:38 ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <5f9c658f-c570-4c01-b9c5-4bcb27d8a4b9(a)k2g2000yqe.googlegroups.com>... > Michael Coughlin > Look up ticks in the help and you'll find info, plus this example: > > x = -pi:.1:pi; > y = sin(x); > plot(x,y) > set(gca,'XTick',-pi:pi/2:pi) > set(gca,'XTickLabel',{'-pi','-pi/2','0','pi/2','pi'}) A possibly simpler solution is to call imagesc with the axes arguments, so Matlab can handle the axes in the normal way... >> imagesc(xticks,yticks,im) imagesc() is essentially equivalent to image(), so you can see the actual documentation for it with >> help image
From: Michael Coughlin on 13 May 2010 20:39 Hi, That works very well! One last question: the y axis has its values inverted whether I flip the y vector values or not. Is there a way to turn on ascending or descending order to force it to do it one way? Michael "Alan B" <monguin61REM(a)OVETHIS.yahoo.com> wrote in message <hshnvc$g75$1(a)fred.mathworks.com>... > ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <5f9c658f-c570-4c01-b9c5-4bcb27d8a4b9(a)k2g2000yqe.googlegroups.com>... > > Michael Coughlin > > Look up ticks in the help and you'll find info, plus this example: > > > > x = -pi:.1:pi; > > y = sin(x); > > plot(x,y) > > set(gca,'XTick',-pi:pi/2:pi) > > set(gca,'XTickLabel',{'-pi','-pi/2','0','pi/2','pi'}) > > A possibly simpler solution is to call imagesc with the axes arguments, so Matlab can handle the axes in the normal way... > >> imagesc(xticks,yticks,im) > > imagesc() is essentially equivalent to image(), so you can see the actual documentation for it with > >> help image
From: ImageAnalyst on 13 May 2010 20:46 On May 13, 8:39 pm, "Michael Coughlin" <cough...(a)carleton.edu> wrote: > Hi, > > That works very well! One last question: the y axis has its values inverted whether I flip the y vector values or not. Is there a way to turn on ascending or descending order to force it to do it one way? > > Michael ---------------------------------------------------------------------------- from the help on axes properties: XDir, YDir, ZDir {normal} | reverse Direction of increasing values. A mode controlling the direction of increasing axis values. Axes form a right-hand coordinate system. By default, * x-axis values increase from left to right. To reverse the direction of increasing x values, set this property to reverse. set(gca,'XDir','reverse') * y-axis values increase from bottom to top (2-D view) or front to back (3-D view). To reverse the direction of increasing y values, set this property to reverse. set(gca,'YDir','reverse') * z-axis values increase pointing out of the screen (2-D view) or from bottom to top (3-D view). To reverse the direction of increasing z values, set this property to reverse. set(gca,'ZDir','reverse')
|
Pages: 1 Prev: Physics Next: illumina solexa sequencing |