Content-Description: Text from file 'polar_patch.txt'
The following patch fixes the "convert columns from polar to rectangular"
command. The original code does not generate y data if the y column doesn't
already exist.
diff -C 2 ./convert.cc ../orig/gri-2.1.19/convert.cc
*** ./convert.cc Fri Nov 13 11:55:03 1998
--- ../orig/gri-2.1.19/convert.cc Sat Oct 24 08:14:38 1998
***************
*** 97,103 ****
double *thetap = _colTHETA.begin();
double theta;
! _colX.setDepth(_colR.size());
! _colY.setDepth(_colR.size());
! for (unsigned int i = 0; i < _colR.size(); i++, rp++, thetap++) {
theta = *thetap / DEG_PER_RAD;
_colX[i] = (*rp) * cos(theta);
--- 97,101 ----
double *thetap = _colTHETA.begin();
double theta;
! for (unsigned int i = 0; i < _colX.size(); i++, rp++, thetap++) {
theta = *thetap / DEG_PER_RAD;
_colX[i] = (*rp) * cos(theta);
The next two patches give an informative error message when trying to draw
polar axes. The original code will draw rectangular axes at the left and
bottom with a simple frame (type 1).
diff -C 2 ./draw.cc ../orig/gri-2.1.19/draw.cc
*** ./draw.cc Fri Dec 18 09:34:27 1998
--- ../orig/gri-2.1.19/draw.cc Sat Oct 24 08:14:38 1998
***************
*** 1114,1126 ****
_top_of_plot = y_cm;
}
- case AXES_POLAR: // polar axis
- {
- err("Polar axes not yet supported");
- return false;
- }
break;
default:
err("unknown axis type");
- return false;
}
gr_setfontsize_pt(oldFontsize_pt);
--- 1114,1120 ----
diff -C 2 ./extern.hh ../orig/gri-2.1.19/extern.hh
*** ./extern.hh Fri Dec 18 08:21:14 1998
--- ../orig/gri-2.1.19/extern.hh Sat Oct 24 08:14:39 1998
***************
*** 17,21 ****
#include "macro.hh"
#define AXES_RECTANGULAR 0 // normal axes style (rect)
! #define AXES_POLAR 50 // polar axes
extern GriState _griState; // <-> gri.cc
--- 17,21 ----
#include "macro.hh"
#define AXES_RECTANGULAR 0 // normal axes style (rect)
! #define AXES_POLAR 1 // polar axes
extern GriState _griState; // <-> gri.cc
--Message-Boundary-15705--
20.3.10. gri 2.1.20 release
On Fri, 18 Dec 1998 15:09:46 -0400 (AST), Dan E Kelley wrote ...
Earlier today, Carl Osterwisch posted here about a patch to gri, to
let it handle the two commands
convert columns from rectangular to polar
convert columns from polar to rectangular
Gri version 2.1.20 has incorporated Osterwisch's suggestions, plus a
tweak to 'show columns'. Please note that full support is not
provided to polar plots. In particular, Gri has no fancy
spoke-and-ring axis style. An example of usage of these commands is
below my sigline. The example is a trivial one; I don't use this sort
of graph in my work and have nothing fancier to offer as a
demonstration.
Gri version 2.1.20 is available at the usual place, in source form at
ftp://ftp.phys.ocean.dal.ca/users/kelley/gri/gri-2.1.20.tgz
and in precompiled (redhat) linux form at
ftp://ftp.phys.ocean.dal.ca/users/kelley/gri/gri-2.1.20-1.rpm
... to post to this (moderated) group, email to gri@phys.ocean.dal.ca.
Dan E. Kelley internet: mailto:Dan.Kelley@Dal.CA
Oceanography Department phone: (902)494-1694
Dalhousie University fax: (902)494-2885
Halifax, NS, CANADA, B3H 4J1 http://www.phys.ocean.dal.ca/~kelley
EXAMPLE GRI COMMANDFILE:
open "awk 'BEGIN{for(r=0;r<=6.2833;r+=0.62832){print cos(r), sin(r);}}'|"
read columns x y
close
show columns
convert columns from rectangular to polar
show columns
convert columns from polar to rectangular
show columns
OUTPUT PRODUCED:
.
.
.
x y
1 0
0.809016 0.587786
0.309014 0.951057
-0.309021 0.951055
-0.80902 0.58778
-1 -7.34641e-06
-0.809012 -0.587792
-0.309007 -0.95106
0.309028 -0.951053
0.809025 -0.587775
1 1.46928e-05
.
.
.
r theta
1 0
1 36.0001
1 72.0002
1 108
0.999999 144
1 -180
1 -144
1 -107.999
1 -71.9993
1 -35.9993
1 0.000841835
.
.
.
x y
1 0
0.809016 0.587786
0.309014 0.951057
-0.309021 0.951055
-0.80902 0.58778
-1 -7.34641e-06
-0.809012 -0.587792
-0.309007 -0.95106
0.309028 -0.951053
0.809025 -0.587775
1 1.46928e-05
20.3.11. Polar patches
On Fri, 18 Dec 1998 14:15:29 -0500, "Carl Osterwisch" wrote ...
--Message-Boundary-19171
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Mail message body
It doesn't look like the patches got forwarded in that last message.
They should be attached to this message.
Carl Osterwisch osterwischc@asme.org
Mechanical Design Engineer Phone 734-995-1755
STM Corporation Fax 734-995-0610
--Message-Boundary-19171
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Text from file 'polar_patch.txt'
The following patch fixes the "convert columns from polar to rectangular"
command. The original code does not generate y data if the y column doesn't
already exist.
diff -C 2 ./convert.cc ../orig/gri-2.1.19/convert.cc
*** ./convert.cc Fri Nov 13 11:55:03 1998
--- ../orig/gri-2.1.19/convert.cc Sat Oct 24 08:14:38 1998
***************
*** 97,103 ****
double *thetap = _colTHETA.begin();
double theta;
! _colX.setDepth(_colR.size());
! _colY.setDepth(_colR.size());
! for (unsigned int i = 0; i < _colR.size(); i++, rp++, thetap++) {
theta = *thetap / DEG_PER_RAD;
_colX[i] = (*rp) * cos(theta);
--- 97,101 ----
double *thetap = _colTHETA.begin();
double theta;
! for (unsigned int i = 0; i < _colX.size(); i++, rp++, thetap++) {
theta = *thetap / DEG_PER_RAD;
_colX[i] = (*rp) * cos(theta);
The next two patches give an informative error message when trying to draw
polar axes. The original code will draw rectangular axes at the left and
bottom with a simple frame (type 1).
diff -C 2 ./draw.cc ../orig/gri-2.1.19/draw.cc
*** ./draw.cc Fri Dec 18 09:34:27 1998
--- ../orig/gri-2.1.19/draw.cc Sat Oct 24 08:14:38 1998
***************
*** 1114,1126 ****
_top_of_plot = y_cm;
}
- case AXES_POLAR: // polar axis
- {
- err("Polar axes not yet supported");
- return false;
- }
break;
default:
err("unknown axis type");
- return false;
}
gr_setfontsize_pt(oldFontsize_pt);
--- 1114,1120 ----
diff -C 2 ./extern.hh ../orig/gri-2.1.19/extern.hh
*** ./extern.hh Fri Dec 18 08:21:14 1998
--- ../orig/gri-2.1.19/extern.hh Sat Oct 24 08:14:39 1998
***************
*** 17,21 ****
#include "macro.hh"
#define AXES_RECTANGULAR 0 // normal axes style (rect)
! #define AXES_POLAR 50 // polar axes
extern GriState _griState; // <-> gri.cc
--- 17,21 ----
#include "macro.hh"
#define AXES_RECTANGULAR 0 // normal axes style (rect)
! #define AXES_POLAR 1 // polar axes
extern GriState _griState; // <-> gri.cc
--Message-Boundary-19171--
20.3.12. join
On Wed, 06 Jan 1999 07:07:07 -0800, Gadiel Alarcon wrote ...
--------------378490E72A7D99019C425C7E
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi Gri users,
First, I have a question....I'm working with a x vs y plot, every plot
is in a different distance from coast and I would like to use a
different symbol to the data, for example: circles for 5 nm from the
coast data, triangles for 10 nm from .......and so on. Furthermore, I'm
using a linear regression for x y plot.
Second, What I have to do to join to the gri news group..
Thanks in advance
Best regards
------Gadiel
--------------378490E72A7D99019C425C7E
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi Gri users,
First, I have a question....I'm working with a x vs y plot, every
plot is in a different distance from coast and I would like to use
a different symbol to the data, for example: circles for 5 nm from the
coast data, triangles for 10 nm from .......and so on. Furthermore, I'm
using a linear regression for x y plot.
Second, What I have to do to join to the gri news group..
Thanks in advance
Best regards
&nbs
p;  
;
------Gadiel
--------------378490E72A7D99019C425C7E--
20.3.13. gri-mode comment lines
On Fri, 08 Jan 1999 12:20:05 -0500, Peter S Galbraith wrote ...
I had always thought that Gri did C-style comments like:
// A comment line
and
/*
A bunch
of comment
lines
*/
I recently discovered that Gri also accept:
# A comment.
Since # is much nicer to use than //, I tried to add it to
gri-mode's syntax table (An emacs syntax table defines stuff like
what is a comment line). The problem was supporting all three
methods. I have it almost working with Emacs-20.3 in gri-mode
V2.03, but Toru Suzuki has reported the code is broken for
Emacs-19.34.
What should I do?
Should gri-mode only support the # character? I could add a
function to gri-mode to make the conversion for users.
This would affect fontification with font-lock and perhaps
indentation.
Or should I let the user choose between
A- Using // and /* */
B- Using only #
in their ~/.emacs file.
Perhaps I could try to support both // and # as comment
characters, but I know _I_ will be changing to only # in my gri
files.
If I don't get any feedback on this from the user community, I'll
assume noone cares and do whatever I want (probably remove
support for // and # entirely) since that is less work for me.
--
Peter Galbraith, research scientist
Maurice Lamontagne Institute, Department of Fisheries and Oceans Canada
P.O. Box 1000, Mont-Joli Qc, G5H 3Z4 Canada. 418-775-0852 FAX: 775-0546
6623'rd GNU/Linux user at the Counter - http://counter.li.org/
20.3.14. Re: gri-mode comment lines
On Fri, 8 Jan 1999 13:51:13 -0400 (AST), "Dan E. Kelley" wrote ...
On Fri, 8 Jan 1999, Peter S Galbraith wrote:
>...
> Should gri-mode only support the # character? I could add a
> function to gri-mode to make the conversion for users.
I think the mode should only support #, especially given difficulties in
supporting multiple styles. The # syntax is more familiar to users of
the c-shell, perl, awk, etc. Also, the commercial gri (now called
'gre') uses '#' for comments.
PS: even I, the gri author, didn't know that /* comment */ worked!
Dan E. Kelley internet: mailto:Dan.Kelley@Dal.CA
Oceanography Department phone: (902)494-1694
Dalhousie University fax: (902)494-2885
Halifax, NS, CANADA, B3H 4J1 http://www.phys.ocean.dal.ca/~kelley