[GRASSLIST:8092] r.profile & subsequent chart plot

i managed to get a nice output from grass's r.profile to get a cross section.

anyone recommend a good program to then plot it with to creat the
cross section graphic?

Good plotting programmes are R or Gnuplot.
Example with the use of R:

GRASS 6.1.cvs (loc):~ > r.profile -i in=yourrast null="NA" > profile

R # start R
profile <- read.table("profile", sep=" ", head=F)
str(pr)

`data.frame': 439 obs. of 2 variables:
$ V1: num 0 100 200 300 400 500 600 700 800 900 ...
$ V2: int NA NA NA NA NA NA NA NA NA NA ...

plot(pr$V1,pr$V2,ty="l")

# If you wish to get height vs. length in equal scale use argument asp=1, e.g.

plot(V1, V2, xlim = c(min(V1, na.rm=T), max(V1, na.rm=T)), ylim = c(min(V2,

na.rm=T), max(V2, na.rm=T)), asp = 1, ty = "l")

Miha Staut

--- M S <mseibel@gmail.com> wrote:

i managed to get a nice output from grass's r.profile to get a cross section.

anyone recommend a good program to then plot it with to creat the
cross section graphic?

___________________________________________________________
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com

I accidentally introduced two errors in the code. Replace all the "pr"-s with
"profile" to get it right, plus add the command attach(profile) before the
second plot command.

Sorry for the mistakes, Miha

--- Miha Staut <mihastaut@yahoo.co.uk> wrote:

Good plotting programmes are R or Gnuplot.
Example with the use of R:

GRASS 6.1.cvs (loc):~ > r.profile -i in=yourrast null="NA" > profile
> R # start R
> profile <- read.table("profile", sep=" ", head=F)
> str(pr)
`data.frame': 439 obs. of 2 variables:
$ V1: num 0 100 200 300 400 500 600 700 800 900 ...
$ V2: int NA NA NA NA NA NA NA NA NA NA ...
> plot(pr$V1,pr$V2,ty="l")

# If you wish to get height vs. length in equal scale use argument asp=1,
e.g.
> plot(V1, V2, xlim = c(min(V1, na.rm=T), max(V1, na.rm=T)), ylim = c(min(V2,
na.rm=T), max(V2, na.rm=T)), asp = 1, ty = "l")

Miha Staut

--- M S <mseibel@gmail.com> wrote:

> i managed to get a nice output from grass's r.profile to get a cross
section.
>
> anyone recommend a good program to then plot it with to creat the
> cross section graphic?

___________________________________________________________
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with
voicemail http://uk.messenger.yahoo.com

___________________________________________________________
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com

hi all, sounds silly, but I just make a graph with excel, and then you can save that graph as a postscript or whatever other format is useful.

-Ian

On Aug 28, 2005, at 2:37 AM, Miha Staut wrote:

Good plotting programmes are R or Gnuplot.
Example with the use of R:

GRASS 6.1.cvs (loc):~ > r.profile -i in=yourrast null="NA" > profile

R # start R
profile <- read.table("profile", sep=" ", head=F)
str(pr)

`data.frame': 439 obs. of 2 variables:
$ V1: num 0 100 200 300 400 500 600 700 800 900 ...
$ V2: int NA NA NA NA NA NA NA NA NA NA ...

plot(pr$V1,pr$V2,ty="l")

# If you wish to get height vs. length in equal scale use argument asp=1, e.g.

plot(V1, V2, xlim = c(min(V1, na.rm=T), max(V1, na.rm=T)), ylim = c(min(V2,

na.rm=T), max(V2, na.rm=T)), asp = 1, ty = "l")

Miha Staut

--- M S <mseibel@gmail.com> wrote:

i managed to get a nice output from grass's r.profile to get a cross section.

anyone recommend a good program to then plot it with to creat the
cross section graphic?

___________________________________________________________
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com

>> i managed to get a nice output from grass's r.profile to get a
>> cross section.
>>
>> anyone recommend a good program to then plot it with to creat the
>> cross section graphic?

..

> Good plotting programmes are R or Gnuplot.

..

hi all, sounds silly, but I just make a graph with excel, and then you

can save that graph as a postscript or whatever other format is
useful.

Nothing silly about it. That's what Excel's good at - having a quick
look at your data. It's just not journal quality ;), multiple plots
using the same template is a pain, and the size of your dataset is
severly limited.

Besides R, Gnuplot, Matlab|Octave, I would recommend checking out GRI
for a great scriptable scientific graphing package (free):
  http://gri.sourceforge.net/

see also GRE (Perl rewrite of GRI):
  http://www.phys.ocean.dal.ca/~kelley/gre/doc/html/

Personally way prefer GRE to GNUplot.

Hamish

Hi All,

I have two additions to the "charting plot" softwares list:

Labplot:
http://labplot.sourceforge.net/

QtiPlot:
http://soft.proindependent.com/qtiplot.html

Labplot also shows a "GRASS Plot". But I don't know how this work ... :frowning:
http://labplot.sourceforge.net/screenshots/grass.png

Cheers,
--
Christian dos Santos Ferreira
Oceanographer. Msc.
Lab. of Fisheries Research and Hydroacustics
Federal University of Rio Grande (FURG)
Rio Grande - RS - Brazil
Tel +55 (53) 32336528
Website: http://poseidon.furg.br