From help-request at octave dot org Thu Jul 14 19:16:23 2005 Subject: Re: trouble reversing x-axis in octave From: "Robert A. Macy" To: bode at ipac dot caltech dot edu Cc: help at octave dot org Date: Thu, 14 Jul 2005 17:11:31 -0700 I don't understand your problem since I don't use any of those commands, and I have a lot of "reversed" ordinates. However, if all else fails reverse them yourself nuordinate=oldordinate(end+1-(1:end)); - Robert - On Thu, 14 Jul 2005 17:02:10 -0500 Andy Boden wrote: > Dear All, > > I am having trouble reversing the x-axis (i.e. displaying > from a larger > to a smaller value going left to right) on a plot > generated by octave, > and I'm wondering if anyone has either seen this same > symptom or know > what I am doing wrong. > > Context dump: > > I have developed an octave application that models > astronomical > photometry with template spectral energy distributions > (SEDs). > > I would like to produce a plot with two horizontal axes > -- spectral > wavelength on one horizontal axis (x2), and frequency on > the other > horizontal (x1) axis. Of course, these two quantities > are inversely > related, so if one ascends left to right, the other must > descend left to > right. > > I am running octave 2.1.71 (via RPM package), and gnuplot > 4.0.0 on a > Fedora Core 4 machine. > > --- > > Symptomology: > > I try to do the right thing in terms of setting the > ranges for the two > axes (code extract): > > ## lMin & lMax in um > eval(sprintf('__gnuplot_set__ x2range > [%f:%f]',lMin,lMax)); > nuMin = cMKS / (lMin * 1e-6); > nuMax = cMKS / (lMax * 1e-6); > eval(sprintf('__gnuplot_set__ xrange > [%f:%f]',nuMin,nuMax)); > > __gnuplot_show__ x2range > __gnuplot_show__ xrange > > Output from the show commands above suggest that all is > as it should be: > > > > set x2range [ 0.115000 : 2.50000 ] noreverse > nowriteback > > > > set xrange [ 2.60522e+17 : 1.19840e+16 ] reverse > nowriteback > > > Plots generated with the following command (more code): > > __gnuplot_plot__ data using 1:2:5:3 t 'Input > Photometry' axes x2y1 with xyerrorbars, \ > data using 1:4 t 'Model Photometry' axes x2y1 > with points, \ > modelSED using 1:2 t 'Model Net (Source + Trans) > SED' axes x2y1 with lines; > > > > have BOTH wavelength and frequency increasing to the > right (bummer!). > [I don't know really how to show that in this context; I > don't think I > should attach a PostScript file to this message, so if > anyone wants to > see the resulting plot I can send them a copy directly.] > > Is it obvious to anyone what I am doing wrong, or is it > possible I've > stumbled onto a bug in octave/gnuplot interaction? > > Thanks in advance for your time in this matter. > > - Andy > > > -- > Andy Boden > bode at ipac dot caltech dot edu > Michelson Science Center/Caltech > http://msc.caltech.edu > 770 S. Wilson Ave, MS 100-22 626/395-1819 > Pasadena, CA 91125 > ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------