Remove graphics.h file.
Jean-baptiste Silvy [Fri, 12 Jan 2007 14:53:05 +0000 (14:53 +0000)]
75 files changed:
scilab/modules/graphics/graphics.vcproj
scilab/modules/graphics/includes/Axes.h
scilab/modules/graphics/includes/Format.h
scilab/modules/graphics/includes/Graphics.h [deleted file]
scilab/modules/graphics/includes/GrayPlot.h [new file with mode: 0644]
scilab/modules/graphics/includes/Plo3d.h
scilab/modules/graphics/includes/PloEch.h
scilab/modules/graphics/includes/Xcall1.h
scilab/modules/graphics/includes/clipping.h
scilab/modules/graphics/includes/math_graphics.h
scilab/modules/graphics/includes/periFig.h
scilab/modules/graphics/includes/periGif.h
scilab/modules/graphics/includes/periPos.h
scilab/modules/graphics/includes/periWin.h
scilab/modules/graphics/includes/periX11.h
scilab/modules/graphics/sci_gateway/sci_champ.c
scilab/modules/graphics/sci_gateway/sci_contour2di.c
scilab/modules/graphics/sci_gateway/sci_demo.c
scilab/modules/graphics/sci_gateway/sci_draw.c
scilab/modules/graphics/sci_gateway/sci_grayplot.c
scilab/modules/graphics/sci_gateway/sci_matplot.c
scilab/modules/graphics/sci_gateway/sci_param3d.c
scilab/modules/graphics/sci_gateway/sci_param3d1.c
scilab/modules/graphics/sci_gateway/sci_plot2d.c
scilab/modules/graphics/sci_gateway/sci_plot2d1.c
scilab/modules/graphics/sci_gateway/sci_xarcs.c
scilab/modules/graphics/sci_gateway/sci_xarrows.c
scilab/modules/graphics/sci_gateway/sci_xchange.c
scilab/modules/graphics/sci_gateway/sci_xpoly.c
scilab/modules/graphics/sci_gateway/sci_xpolys.c
scilab/modules/graphics/sci_gateway/sci_xset.c
scilab/modules/graphics/src/c/Actions.c
scilab/modules/graphics/src/c/Axes.c
scilab/modules/graphics/src/c/BuildObjects.c
scilab/modules/graphics/src/c/Champ.c
scilab/modules/graphics/src/c/CloneObjects.c
scilab/modules/graphics/src/c/Contour.c
scilab/modules/graphics/src/c/DestroyObjects.c
scilab/modules/graphics/src/c/DrawObjects.c
scilab/modules/graphics/src/c/FeC.c
scilab/modules/graphics/src/c/Fec.h
scilab/modules/graphics/src/c/Format.c
scilab/modules/graphics/src/c/GetProperty.c
scilab/modules/graphics/src/c/Gray.c
scilab/modules/graphics/src/c/HandleManagement.c
scilab/modules/graphics/src/c/InitObjects.c
scilab/modules/graphics/src/c/Interaction.c
scilab/modules/graphics/src/c/Plo2dEch.c
scilab/modules/graphics/src/c/Plo2dn.c
scilab/modules/graphics/src/c/Plo3d.c
scilab/modules/graphics/src/c/Plo3dn.c
scilab/modules/graphics/src/c/SetProperty.c
scilab/modules/graphics/src/c/Xcall.c
scilab/modules/graphics/src/c/Xcall1.c
scilab/modules/graphics/src/c/clipping.c
scilab/modules/graphics/src/c/handleDrawing/drawGrayplotEntity.c
scilab/modules/graphics/src/c/handleDrawing/drawPolylineEntity.c
scilab/modules/graphics/src/c/handleDrawing/drawSegsEntity.c
scilab/modules/graphics/src/c/periFig.c
scilab/modules/graphics/src/c/periGif.c
scilab/modules/graphics/src/c/periPos.c
scilab/modules/graphics/src/c/periWin.c
scilab/modules/graphics/src/c/sciCall.c
scilab/modules/graphics/src/c/xs2file.c
scilab/modules/gui/src/c/wsci/FigureToFile.h
scilab/modules/gui/src/c/wsci/FigureToPrint.h
scilab/modules/gui/src/c/wsci/Toolbar.h
scilab/modules/gui/src/c/wsci/WndGraphProc.c
scilab/modules/gui/src/c/wsci/WndGraphProc.h
scilab/modules/gui/src/c/wsci/wcommon.h
scilab/modules/gui/src/c/wsci/wgmenu.c
scilab/modules/gui/src/c/wsci/wgmenu.h
scilab/modules/gui/src/c/wsci/wgraph.c
scilab/modules/gui/src/c/wsci/wgraph.h
scilab/modules/gui/src/c/wsci/wmenu.c

index 266f05b..3262ed2 100644 (file)
                        Filter="h;hpp;hxx;hm;inl"
                        >
                        <File
+                               RelativePath=".\includes\Actions.h"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\includes\Axes.h"
                                >
                        </File>
                                >
                        </File>
                        <File
+                               RelativePath=".\includes\Contour.h"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\includes\DefaultCommandArg.h"
                                >
                        </File>
                                >
                        </File>
                        <File
+                               RelativePath=".\includes\GrayPlot.h"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\includes\gsort.h"
                                >
                        </File>
index 0819846..e74c4d8 100644 (file)
@@ -125,6 +125,17 @@ void axis_draw2(char strflag[]) ;
 void Sci_Axis(char pos, char xy_type, double *x, int *nx, double *y, int *ny,
               char *str[], int subtics, char *format, int fontsize, int textcolor, 
               int fontstyle, int ticscolor, char logflag, int seg_flag, int axisbuild_flag) ;
+/**
+ * Trace un triedre : Indices[4] donne les indices des points qui 
+ * constituent le triedre dans les tableaux xbox et ybox
+ */
+void DrawAxis(double xbox[8], double ybox[8], integer Indices[4], integer style) ;
+
+/**
+ * @author F.Leray 18.10.04
+ */
+int Axes3dStrings2( integer * ixbox, integer * iybox, integer * xind ) ;
+
 /*--------------------------------------------------------------------------------------*/
 
 #endif /*__SCI_AXES_H_*/
index 7749c72..54d8570 100644 (file)
@@ -22,6 +22,26 @@ StringMatrix * computeDefaultTicsLabels( sciPointObj * pobj ) ;
 
 int ChooseGoodFormat( char * c_format,char logflag, double *_grads,int n_grads ) ;
 
+/**
+ * same as ChoixFormatE when numbers are given through an 
+ * array xx[0:nx-1];
+ */
+void ChoixFormatE1(char *fmt, double *xx, integer nx) ;
+
+/**
+ * ChoixFormatE returns a format ("%.*f" or "%.*e")
+ * in fmt given xmin,xmax,pas. 
+ *   fmt : character string 
+ * fmt gives a format which can be used to display
+ * number in range xmin:step:xmax  
+ * Exemple : ChoixFormatE(format,min,max,step);
+ *           fprintf(format,min+k*step);
+ * The format is searched so as to give distinct values 
+ * for the numeric values xmin + k*xpas in [xmin,xmax] 
+ * and give enough precision. 
+ */
+void ChoixFormatE(char *fmt, double xmin, double xmax, double xpas) ;
+
 double * ReBuildTicksLog2Lin(char logflag, int nbtics, double *grads) ;
 
 int ComputeXIntervals( sciPointObj * pobj, char xy_type, double ** vector, int * N, int checkdim ) ;
@@ -45,4 +65,12 @@ char * copyFormatedValue( double value, const char format[5], int bufferSize ) ;
 */
 char ** copyFormatedArray( const double values[], int nbStrings, const char format[5], int bufferSize ) ;
 
+int TheTicks( double * xminv ,
+              double * xmaxv , 
+              double * grads , 
+              int    * ngrads,
+              int      compNgrads ) ;
+
+int GradEqual( const double grads[], const int * ngrads) ;
+
 #endif /* _FORMAT_H_ */
diff --git a/scilab/modules/graphics/includes/Graphics.h b/scilab/modules/graphics/includes/Graphics.h
deleted file mode 100644 (file)
index af19e55..0000000
+++ /dev/null
@@ -1,621 +0,0 @@
-/*------------------------------------------------------------------------
- *    Graphic library
- *    Copyright (C) 1998-2000 Enpc/Jean-Philippe Chancelier
- *    jpc@cereve.enpc.fr 
- --------------------------------------------------------------------------*/
-
-#ifndef SCIG_PROTO
-#define SCIG_PROTO
-
-#include "machine.h"
-#include "sciprint.h"
-/* #include "ObjectStructure.h" */
-
-/*Actions.c */
-
-typedef int (*Scig_handler) __PARAMS((int));
-extern Scig_handler set_scig_handler __PARAMS(( Scig_handler f));
-extern Scig_handler scig_handler;
-
-extern int C2F(xg2psofig) __PARAMS((char *,integer *,integer *,integer *,char *,long int,long int)); 
-extern int scig_2dzoom __PARAMS((integer )); 
-extern void scig_unzoom __PARAMS((integer )); 
-extern void scig_replay __PARAMS((integer )); 
-extern void scig_expose __PARAMS((integer )); 
-extern int scig_3drot __PARAMS((integer )); 
-extern void scig_sel __PARAMS((integer )); 
-extern void scig_raise __PARAMS((integer )); 
-extern void scig_loadsg __PARAMS((int ,char *)); 
-extern void scig_resize __PARAMS((integer )); 
-extern void scig_resize_pixmap __PARAMS((integer )); 
-extern void scig_erase __PARAMS((integer )); 
-
-
-/* Axes.c */
-
-extern void Sci_Axis __PARAMS((char,char,double *,int *,double *,int*,char *str[],int subtics,char *format,
-                             int fontsize,int textcolor,int fontstyle,int ticscolor,char logflag,int seg_flag , int axisbuild_flag));
-extern void sci_axis __PARAMS((char,char,double *,int *,double *,int*,char *str[],int subtics,char *format,
-                             int fontsize,int textcolor,int fontstyle,int ticscolor,char logflag,int seg_flag));
-extern void axis_draw  __PARAMS(( char strflag[]));
-extern void axis_draw2  __PARAMS(( char strflag[]));
-extern void DrawAxesBackground __PARAMS((void));
-
-extern void ChoixFormatE  __PARAMS((char *fmt,double xmin,double xmax,double xpas)); 
-extern void ChoixFormatE1  __PARAMS((char *fmt,double *x,integer nx)); 
-extern void C2F(aplot)  __PARAMS((integer *,double *,double *,double *,double *,integer *,integer *,char *)); 
-
-/* Champ.c */
-
-extern int C2F(champ)  __PARAMS((double *,double *,double *,double *,integer *,integer *,char *,double *,double *,integer)); 
-extern int C2F(champ1)  __PARAMS((double *,double *,double *,double *,integer *,integer *,char *,double *,double *,integer)); 
-extern void champg  __PARAMS((char *,integer ,double *,double *,double *,double *,integer *,integer *,char *,double *,double *,integer)); 
-       
-       /* Contour.c */
-
-extern int C2F(getconts) __PARAMS((double **x,double **y,integer *mm,integer *n));
-extern int C2F(contour2)  __PARAMS((double *,double *,double *,integer *,integer *,integer *,integer *,double *,integer *,char *,char *,double *,integer *,integer,integer)); 
-extern int C2F(contourif)  __PARAMS((double *,double *,double *,integer *,integer *,integer *,integer *,double *,integer *)); 
-
-       /* FeC.c */
-
-extern int C2F(fec)  __PARAMS((double *,double *,double *triangles,double *func,integer *Nnode,integer *Ntr,char *,char *,double *,integer *, double *, integer *, integer *, integer with_mesh, integer flagNax, integer,integer)); 
-
-/* extern int C2F(fec)  __PARAMS((double *,double *,double *triangles,double *func,integer *Nnode,integer *Ntr,char *,char *,double *,integer *,integer,integer));  */
-
-
-/* Gray.c */
-
-extern int C2F(xgray)  __PARAMS((double *,double *,double *,integer *,integer *,char *,double *,integer *,integer flagNax,long int l1)); 
-
-extern int C2F(xgray1) __PARAMS((double *z,integer *n1,integer *n2,char *strflag,double *brect,integer *aaint,integer flagNax,long int l1));
-
-extern int C2F(xgray2) __PARAMS((double *z,integer *n1,integer *n2,double *xrect));
-
-
-/* Math.c */
-
-extern double Mini  __PARAMS((double *vect,integer));
-extern double Maxi  __PARAMS((double *vect,integer));
-
-       /* Plo2d.c */
-extern void AxisDraw  __PARAMS((double *,integer *,integer *,integer *,integer *,double,double,double,double,char *,char *)); 
-extern void FrameBounds  __PARAMS((char *,double *,double *,integer *,integer *,integer *,char *,double *,double *,integer *,integer *)); 
-extern void Legends  __PARAMS(( integer *,integer *,char *)); 
-
-/* Plo2d1.c */
-
-extern int CheckxfParam  __PARAMS((char *)); 
-extern int C2F(plot2d1)  __PARAMS((char *,double *,double *,integer *,integer *,integer *,char *,char *,double *,integer *,integer,integer,integer)); 
-
-       /* Plo2d2.c */
-
-extern int C2F(plot2d2)  __PARAMS((char *,double *,double *,integer *,integer *,integer *,char *,char *,double *,integer *,integer,integer,integer)); 
-
-/* Plo2d3.c */
-
-extern int C2F(plot2d3)  __PARAMS((char *,double *,double *,integer *,integer *,integer *,char *,char *,double *,integer *,integer,integer,integer )); 
-
-/* Plo2d4.c */
-
-extern int C2F(plot2d4)  __PARAMS((char *,double *,double *,integer *,integer *,integer *,char *,char *,double *,integer *,integer,integer,integer)); 
-
-/* Plo2dEch.c */
-
-extern void update_frame_bounds  __PARAMS((int cflag,char *xf,double *x,double *y,integer *n1,integer *n2,integer *aaint,char *strflag,double *brect));
-
-void frame_clip_on  __PARAMS((void));
-void frame_clip_off  __PARAMS((void));
-extern int C2F(xechelle2d) __PARAMS((double x[],integer x1[],integer *n1,char dir[],integer lstr));
-extern int C2F(yechelle2d) __PARAMS((double x[],integer x1[],integer *n1,char dir[],integer lstr));
-
-extern void set_scale __PARAMS((char flag[],double subwin[],double frame_values[],int aaint[],char logflag[],double axis[]));
-extern int C2F(graduate)  __PARAMS((double *,double *,double *,double *,integer *,integer *,integer *,integer *,integer *)); 
-
-/* Theticks F.Leray 21.09.04 */
-extern int C2F(theticks) __PARAMS((double *xminv, double *xmaxv, double *grads, int *ngrads));
-extern int TheTicks( double *xminv, double * xmaxv, double * grads, int * ngrads, int compNgrads ) ;
-extern int GradEqual(const double * grads,const int *ngrads);
-
-extern void Cscale2default  __PARAMS((void)); 
-
-
-extern void set_window_scale_with_default  __PARAMS((integer i));
-extern int get_window_scale  __PARAMS((integer,double * )); 
-extern void del_window_scale  __PARAMS((integer)); 
-
-extern void Scale2D  __PARAMS((integer,double *,integer *,integer *,double *,double *,double *,double *,char *));
-extern int C2F(setscale2d)  __PARAMS((double *,double *,char *,integer)); 
-extern int C2F(Nsetscale2d)  __PARAMS((double *,double *,double *,char *,integer)); 
-extern int getscale2d  __PARAMS((double *,double *,char *,double *)); 
-extern void get_margin_in_pixel(integer *);
-extern int C2F(echelle2d)  __PARAMS((double *,double *,integer *,integer *,integer *,integer *, char *,integer)); 
-extern void C2F(echelle2dl)  __PARAMS((double *,double *,integer *,integer *,integer *,integer *,char *)); 
-extern void C2F(ellipse2d)  __PARAMS((double *,integer *,integer *,char *)); 
-extern void C2F(rect2d)  __PARAMS((double *,integer *,integer *,char *)); 
-extern void C2F(axis2d)  __PARAMS((double *,double *,double *,integer *,double *)); 
-extern int zoom  __PARAMS((void)); 
-extern int zoom_get_rectangle    __PARAMS((double bbox[], int *x_pixel, int *y_pixel));
-
-extern void unzoom  __PARAMS((void)); 
-extern void Gr_Rescale  __PARAMS((char *,double *,integer *,integer *,integer *,integer *)); 
-extern void Gr_Rescale2  __PARAMS((char *,double *,integer *,integer *,integer *,integer *)); /* F.Leray 20.04.04 */
-extern void C2F(aplot1)  __PARAMS((double *,integer *,integer *,integer *,integer *npx,integer *npy,char *logflag,double scx,double scy,double xofset,double yofset)); 
-
-       /* Plo3d.c */
-
-int shade __PARAMS(( integer *polyx, integer *polyy, integer *fill, integer polysize, integer flag));
-void GetEch3d1  __PARAMS(( double (*m1)[3],double *,double *,double *,double *));
-void GetEch3d   __PARAMS((void));
-extern void AxesStrings  __PARAMS((integer,integer *,integer *,integer *,char *,double *)); 
-extern void MaxiInd  __PARAMS((double *,integer,integer *,double)); 
-extern void UpNext  __PARAMS((integer ,integer *,integer *)); 
-extern void DownNext  __PARAMS((integer ,integer *,integer *)); 
-extern void TDAxis  __PARAMS((integer flag,double FPval,double LPval,integer *nax,integer *FPoint,integer *LPoint,integer *Ticsdir)); 
-extern void C2F(TDdrawaxis)  __PARAMS((double ,double FPval,double LPval,integer *nax,integer *FPoint,integer *LPoint,integer *Ticsdir)); 
-extern void BBoxToval  __PARAMS((double *,double *,double *,integer ,double *)); 
-extern int I3dRotation  __PARAMS((void)); 
-extern int C2F(box3d)  __PARAMS((double *,double *,double *)); 
-extern void SetEch3d  __PARAMS((double *,double *,double *,double *,double *teta,double *)); 
-extern void SetEch3d1  __PARAMS((double *,double *,double *,double *,double *teta,double *,integer flag)); 
-extern void DrawAxis  __PARAMS((double *,double *,integer *Indices,integer style)); 
-extern void Convex_Box  __PARAMS((double *,double *,integer *,integer *,char *,integer *,double *)); 
-
-
-/* Xcall.c */
-
-extern void C2F(SetDriver)  __PARAMS((char * ,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-
-extern void GetDriver1  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-
-extern char GetDriver  __PARAMS((void)); 
-extern int GetDriverId __PARAMS((void)); 
-extern int C2F(inttest) __PARAMS((int *)); 
-
-/* Xcall1 */
-
-extern int C2F(xsetg) __PARAMS((char *str,char *str1,integer lx0,integer lx1));
-extern int C2F(xgetg) __PARAMS((char *str,char *str1,integer *len,integer lx0,integer lx1));
-extern char *getFPF __PARAMS((void));
-
-/* periFig.c */
-
-extern void C2F(getcursymbolXfig)  __PARAMS((integer *,integer *,integer *,double *)); 
-extern void C2F(semptyXfig)  __PARAMS((integer *,integer *,integer *,integer *)); 
-extern void C2F(gemptyXfig)  __PARAMS((integer *,integer *,integer *,double *)); 
-extern void C2F(scilabgcgetXfig)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(scilabgcsetXfig)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(ScilabGCGetorSetXfig)  __PARAMS((char *,integer flag,integer *,integer *,integer *,integer *,integer *,integer *,integer *,double *)); 
-extern void C2F(displaystringXfig)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *angle,double *,double *,double *)); 
-extern void C2F(boundingboxXfig)  __PARAMS((char *,integer *,integer *,integer *rect,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(drawlineXfig)  __PARAMS((integer *,integer *,integer *,integer *)); 
-extern void C2F(drawsegmentsXfig)  __PARAMS((char *,integer *,integer *vy,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(drawarrowsXfig)  __PARAMS((char *,integer *,integer *vy,integer *,integer *as,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(drawrectangleXfig)  __PARAMS((char *,integer *,integer *,integer *width,integer *height,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(fillrectangleXfig)  __PARAMS((char *,integer *,integer *,integer *width,integer *height,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(drawrectanglesXfig)  __PARAMS((char *,integer *vects,integer *fillvect,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(fillarcsXfig)  __PARAMS((char *,integer *vects,integer *fillvect,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(drawarcsXfig)  __PARAMS((char *,integer *vects,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(drawarcXfig)  __PARAMS((char *,integer *,integer *,integer *width,integer *height,integer *angle1,integer *angle2,double *,double *,double *,double *)); 
-extern void C2F(xselgraphicXfig)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(fillarcXfig)  __PARAMS((char *,integer *,integer *,integer *width,integer *height,integer *angle1,integer *angle2,double *,double *,double *,double *)); 
-extern void C2F(drawpolymarkXfig)  __PARAMS((char *,integer *,integer *,integer *vy,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(drawpolylinesXfig)  __PARAMS((char *,integer *vectsx,integer *vectsy,integer *rawvect,integer *,integer *p,integer *,double *,double *,double *,double *)); 
-extern void C2F(fillpolylinesXfig)  __PARAMS((char *,integer *vectsx,integer *vectsy,integer *fillvect,integer *,integer *p,integer *,double *,double *,double *,double *)); 
-extern void C2F(drawpolylineXfig)  __PARAMS((char *,integer *,integer *,integer *vy,integer *closeflag,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(xendgraphicXfig)  __PARAMS((void)); 
-extern void C2F(fillpolylineXfig)  __PARAMS((char *,integer *,integer *,integer *vy,integer *closeareaflag,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(initgraphicXfig)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(xendXfig)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-
-extern void C2F(InitScilabGCXfig)  __PARAMS((integer *,integer *,integer *,integer *)); 
-extern void C2F(loadfamilyXfig)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(drawaxisXfig)  __PARAMS((char *,integer *,integer *nsteps,integer *,integer *initpoint,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(clearwindowXfig)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(displaynumbersXfig)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void set_pattern_or_color __PARAMS((int pat,int *areafill,int *color)); 
-/* extern void set_dash_or_color  __PARAMS((int dash,int *l_style,int *_val,int *color)); */
-extern void C2F(viderbuffXfig)  __PARAMS((void)); 
-extern void C2F(WriteGenericXfig)  __PARAMS((char *,integer nobj,integer sizeobj,integer *,integer *vy,integer sizev,integer flag,integer *fvect)); 
-extern void C2F(getwindowdimXfig)  __PARAMS((integer *,integer *,integer *,double *)); 
-extern void C2F(Write2VectXfig)  __PARAMS((integer *,integer *vy,integer,integer flag)); 
-extern void C2F(setwindowdimXfig)  __PARAMS((integer *,integer *,integer *,integer *)); 
-extern void C2F(getwindowposXfig)  __PARAMS((integer *,integer *,integer *,double *)); 
-extern void C2F(setwindowposXfig)  __PARAMS((integer *,integer *,integer *,integer *)); 
-extern void C2F(xclickXfig)  __PARAMS((char *,integer *ibutton,integer *x1,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(xclick_anyXfig)  __PARAMS((char *,integer *ibutton,integer *x1,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(xgetmouseXfig)  __PARAMS((char *,integer *ibutton,integer *x1,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(clearareaXfig)  __PARAMS((char *,integer *,integer *,integer *w,integer *h,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(setcurwinXfig)  __PARAMS((integer *intnum,integer *,integer *,integer *)); 
-extern void C2F(getcurwinXfig)  __PARAMS((integer *,integer *intnum,integer *,double *)); 
-extern void C2F(setclipXfig)  __PARAMS((integer *,integer *,integer *w,integer *h)); 
-extern void C2F(unsetclipXfig)  __PARAMS((integer *,integer *,integer *,integer *)); 
-extern void C2F(getclipXfig)  __PARAMS((integer *,integer *,integer *,double *)); 
-extern void C2F(absourelXfig)  __PARAMS((integer *num,integer *,integer *,integer *)); 
-extern void C2F(getabsourelXfig)  __PARAMS((integer *,integer *num,integer *,double *)); 
-extern void C2F(setalufunctionXfig)  __PARAMS((char *)); 
-extern void C2F(idfromnameXfig)  __PARAMS((char *,integer *num)); 
-extern void C2F(setalufunction1Xfig)  __PARAMS((integer *num,integer *,integer *,integer *)); 
-extern void C2F(getalufunctionXfig)  __PARAMS((integer *,integer *value,integer *,double *)); 
-extern void C2F(setthicknessXfig)  __PARAMS((integer *value,integer *,integer *,integer *)); 
-extern void C2F(getthicknessXfig)  __PARAMS((integer *,integer *value,integer *,double *)); 
-extern void C2F(setpatternXfig)  __PARAMS((integer *num,integer *,integer *,integer *)); 
-extern void C2F(getpatternXfig)  __PARAMS((integer *,integer *num,integer *,double *)); 
-extern void C2F(getlastXfig)  __PARAMS((integer *,integer *num,integer *,double *)); 
-extern void C2F(setdashXfig)  __PARAMS((integer *value,integer *,integer *,integer *)); 
-extern void C2F(getdashXfig)  __PARAMS((integer *,integer *value,integer *,double *)); 
-extern void C2F(usecolorXfig)  __PARAMS((integer *num,integer *,integer *,integer *)); 
-extern void C2F(getusecolorXfig)  __PARAMS((integer *,integer *num,integer *,double *)); 
-extern void C2F(setcolormapXfig)  __PARAMS((integer *,integer *,integer *,integer *,integer *,integer *,double *a)); 
-extern void C2F(set_cXfig)  __PARAMS((integer i)); 
-extern void C2F(setbackgroundXfig)  __PARAMS((integer *num,integer *,integer *,integer *)); 
-extern void C2F(getbackgroundXfig)  __PARAMS((integer *,integer *num,integer *,double *)); 
-extern void C2F(setforegroundXfig)  __PARAMS((integer *num,integer *,integer *,integer *)); 
-extern void C2F(getforegroundXfig)  __PARAMS((integer *,integer *num,integer *,double *)); 
-extern void C2F(sethidden3dXfig)  __PARAMS((integer *num,integer *,integer *,integer *)); 
-extern void C2F(gethidden3dXfig)  __PARAMS((integer *,integer *num,integer *,double *)); 
-extern void C2F(xsetfontXfig)  __PARAMS((integer *,integer *,integer *,integer *)); 
-extern void C2F(xgetfontXfig)  __PARAMS((integer *,integer *,integer *,double *)); 
-extern void C2F(setcursymbolXfig)  __PARAMS((integer *,integer *,integer *,integer *)); 
-
-/* periPos.c */
-
-extern void ColorInit  __PARAMS((void)); 
-extern void C2F(gemptyPos)  __PARAMS((integer *,integer *,integer *,double *)); 
- extern void C2F(scilabgcgetPos)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(scilabgcsetPos)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(ScilabGCGetorSetPos)  __PARAMS((char *,integer flag,integer *,integer *,integer *,integer *,integer *,integer *,integer *,double *)); 
- extern void C2F(displaystringPos)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *angle,double *,double *,double *)); 
- extern void C2F(boundingboxPos)  __PARAMS((char *,integer *,integer *,integer *rect,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(drawlinePos)  __PARAMS((integer *x1,integer *,integer *,integer *)); 
- extern void C2F(drawsegmentsPos)  __PARAMS((char *,integer *,integer *vy,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(drawarrowsPos)  __PARAMS((char *,integer *,integer *vy,integer *,integer *as,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(xselgraphicPos)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(drawrectanglesPos)  __PARAMS((char *,integer *vects,integer *fillvect,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(drawrectanglePos)  __PARAMS((char *,integer *,integer *,integer *width,integer *height,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(fillrectanglePos)  __PARAMS((char *,integer *,integer *,integer *width,integer *height,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(fillarcsPos)  __PARAMS((char *,integer *vects,integer *fillvect,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(drawarcsPos)  __PARAMS((char *,integer *vects,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(drawarcPos)  __PARAMS((char *,integer *,integer *,integer *width,integer *height,integer *angle1,integer *angle2,double *,double *,double *,double *)); 
- extern void C2F(fillarcPos)  __PARAMS((char *,integer *,integer *,integer *width,integer *height,integer *angle1,integer *angle2,double *,double *,double *,double *)); 
- extern void C2F(xendgraphicPos)  __PARAMS((void)); 
- extern void C2F(drawpolylinesPos)  __PARAMS((char *,integer *vectsx,integer *vectsy,integer *rawvect,integer *,integer *p,integer *,double *,double *,double *,double *)); 
- extern void C2F(fillpolylinesPos)  __PARAMS((char *,integer *vectsx,integer *vectsy,integer *fillvect,integer *,integer *p,integer *,double *,double *,double *,double *)); 
- extern void C2F(xendPos)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(drawpolylinePos)  __PARAMS((char *,integer *,integer *,integer *vy,integer *closeflag,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(fillpolylinePos)  __PARAMS((char *,integer *,integer *,integer *vy,integer *closeareaflag,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(drawpolymarkPos)  __PARAMS((char *,integer *,integer *,integer *vy,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(initgraphicPos)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void InitScilabGCPos  __PARAMS((integer *,integer *,integer *,integer *)); 
- extern void C2F(clearwindowPos)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(drawaxisPos)  __PARAMS((char *,integer *,integer *nsteps,integer *,integer *initpoint,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(displaynumbersPos)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(WriteGenericPos)  __PARAMS((char *,integer nobj,integer sizeobj,integer *,integer *vy,integer sizev,integer flag,integer *fvect)); 
- extern void C2F(WriteGeneric1Pos)  __PARAMS((char *,integer nobjpos,integer objbeg,integer sizeobj,integer *,integer *vy,integer flag,integer *fvect)); 
- extern void C2F(Write2VectPos)  __PARAMS((integer *,integer *vy,integer from,integer,char *,integer flag,integer fv)); 
- extern void C2F(xsetfontPos)  __PARAMS((integer *,integer *,integer *,integer *)); 
- extern void C2F(xgetfontPos)  __PARAMS((integer *,integer *,integer *,double *)); 
- extern void C2F(xsetmarkPos)  __PARAMS((integer *,integer *,integer *,integer *)); 
- extern void C2F(xgetmarkPos)  __PARAMS((integer *,integer *,integer *,double *)); 
- extern void C2F(xclickPos)  __PARAMS((char *,integer *ibutton,integer *x1,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(loadfamilyPos)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(xclick_anyPos)  __PARAMS((char *,integer *ibutton,integer *x1,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(xgetmousePos)  __PARAMS((char *,integer *ibutton,integer *x1,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(clearareaPos)  __PARAMS((char *,integer *,integer *,integer *w,integer *h,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(getwindowposPos)  __PARAMS((integer *,integer *,integer *,double *)); 
- extern void C2F(setwindowposPos)  __PARAMS((integer *,integer *,integer *,integer *)); 
- extern void C2F(getwindowdimPos)  __PARAMS((integer *,integer *,integer *,double *)); 
- extern void C2F(setwindowdimPos)  __PARAMS((integer *,integer *,integer *,integer *)); 
- extern void C2F(setcurwinPos)  __PARAMS((integer *intnum,integer *,integer *,integer *)); 
- extern void C2F(getcurwinPos)  __PARAMS((integer *,integer *intnum,integer *,double *)); 
- extern void C2F(setclipPos)  __PARAMS((integer *,integer *,integer *w,integer *h)); 
- extern void C2F(unsetclipPos)  __PARAMS((integer *,integer *,integer *,integer *)); 
- extern void C2F(getclipPos)  __PARAMS((integer *,integer *,integer *,double *)); 
- extern void C2F(setabsourelPos)  __PARAMS((integer *num,integer *,integer *,integer *)); 
- extern void C2F(getabsourelPos)  __PARAMS((integer *,integer *num,integer *,double *)); 
- extern void C2F(setalufunctionPos)  __PARAMS((char *)); 
- extern void C2F(idfromnamePos)  __PARAMS((char *,integer *num)); 
- extern void C2F(setalufunction1Pos)  __PARAMS((integer *num,integer *,integer *,integer *)); 
- extern void C2F(getalufunctionPos)  __PARAMS((integer *,integer *value,integer *,double *)); 
- extern void C2F(setthicknessPos)  __PARAMS((integer *value,integer *,integer *,integer *)); 
- extern void C2F(getthicknessPos)  __PARAMS((integer *,integer *value,integer *,double *)); 
- extern void C2F(setpatternPos)  __PARAMS((integer *num,integer *,integer *,integer *)); 
- extern void C2F(getpatternPos)  __PARAMS((integer *,integer *num,integer *,double *)); 
- extern void C2F(getlastPos)  __PARAMS((integer *,integer *num,integer *,double *)); 
- extern void C2F(setdashPos)  __PARAMS((integer *value,integer *,integer *,integer *)); 
- extern void C2F(setdashstylePos)  __PARAMS((integer *value,integer *x,integer *n)); 
- extern void C2F(getdashPos)  __PARAMS((integer *,integer *value,integer *,double *)); 
- extern void C2F(usecolorPos)  __PARAMS((integer *num,integer *,integer *,integer *)); 
- extern void C2F(getusecolorPos)  __PARAMS((integer *,integer *num,integer *,double *)); 
- extern void C2F(setcolormapPos)  __PARAMS((integer *,integer *,integer *,integer *,integer *,integer *,double *a)); 
- extern void C2F(set_cPos)  __PARAMS((integer i)); 
- extern void C2F(setbackgroundPos)  __PARAMS((integer *num,integer *,integer *,integer *)); 
- extern void C2F(getbackgroundPos)  __PARAMS((integer *,integer *num,integer *,double *)); 
- extern void C2F(setforegroundPos)  __PARAMS((integer *num,integer *,integer *,integer *)); 
- extern void C2F(getforegroundPos)  __PARAMS((integer *,integer *num,integer *,double *)); 
- extern void C2F(sethidden3dPos)  __PARAMS((integer *num,integer *,integer *,integer *)); 
- extern void C2F(gethidden3dPos)  __PARAMS((integer *,integer *num,integer *,double *)); 
- extern void C2F(semptyPos)  __PARAMS((integer *,integer *,integer *,integer *)); 
-       
-       /* periGif.c */
-
-extern void C2F(gemptyGif)  __PARAMS((integer *,integer *,integer *,double *)); 
- extern void C2F(scilabgcgetGif)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(scilabgcsetGif)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(ScilabGCGetorSetGif)  __PARAMS((char *,integer flag,integer *,integer *,integer *,integer *,integer *,integer *,integer *,double *)); 
- extern void C2F(displaystringGif)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *angle,double *,double *,double *)); 
- extern void C2F(boundingboxGif)  __PARAMS((char *,integer *,integer *,integer *rect,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(drawlineGif)  __PARAMS((integer *x1,integer *,integer *,integer *)); 
- extern void C2F(drawsegmentsGif)  __PARAMS((char *,integer *,integer *vy,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(drawarrowsGif)  __PARAMS((char *,integer *,integer *vy,integer *,integer *as,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(xselgraphicGif)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(drawrectanglesGif)  __PARAMS((char *,integer *vects,integer *fillvect,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(drawrectangleGif)  __PARAMS((char *,integer *,integer *,integer *width,integer *height,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(fillrectangleGif)  __PARAMS((char *,integer *,integer *,integer *width,integer *height,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(fillarcsGif)  __PARAMS((char *,integer *vects,integer *fillvect,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(drawarcsGif)  __PARAMS((char *,integer *vects,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(drawarcGif)  __PARAMS((char *,integer *,integer *,integer *width,integer *height,integer *angle1,integer *angle2,double *,double *,double *,double *)); 
- extern void C2F(fillarcGif)  __PARAMS((char *,integer *,integer *,integer *width,integer *height,integer *angle1,integer *angle2,double *,double *,double *,double *)); 
- extern void C2F(xendgraphicGif)  __PARAMS((void)); 
- extern void C2F(drawpolylinesGif)  __PARAMS((char *,integer *vectsx,integer *vectsy,integer *rawvect,integer *,integer *p,integer *,double *,double *,double *,double *)); 
- extern void C2F(fillpolylinesGif)  __PARAMS((char *,integer *vectsx,integer *vectsy,integer *fillvect,integer *,integer *p,integer *,double *,double *,double *,double *)); 
- extern void C2F(xendGif)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(drawpolylineGif)  __PARAMS((char *,integer *,integer *,integer *vy,integer *closeflag,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(fillpolylineGif)  __PARAMS((char *,integer *,integer *,integer *vy,integer *closeareaflag,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(drawpolymarkGif)  __PARAMS((char *,integer *,integer *,integer *vy,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(initgraphicGif)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void InitScilabGCGif  __PARAMS((integer *,integer *,integer *,integer *)); 
- extern void C2F(clearwindowGif)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(drawaxisGif)  __PARAMS((char *,integer *,integer *nsteps,integer *,integer *initpoint,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(displaynumbersGif)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(WriteGenericGif)  __PARAMS((char *,integer nobj,integer sizeobj,integer *,integer *vy,integer sizev,integer flag,integer *fvect)); 
- extern void C2F(WriteGeneric1Gif)  __PARAMS((char *,integer nobjpos,integer objbeg,integer sizeobj,integer *,integer *vy,integer flag,integer *fvect)); 
- extern void C2F(Write2VectGif)  __PARAMS((integer *,integer *vy,integer from,integer,char *,integer flag,integer fv)); 
- extern void C2F(xsetfontGif)  __PARAMS((integer *,integer *,integer *,integer *)); 
- extern void C2F(xgetfontGif)  __PARAMS((integer *,integer *,integer *,double *)); 
- extern void C2F(xsetmarkGif)  __PARAMS((integer *,integer *,integer *,integer *)); 
- extern void C2F(xgetmarkGif)  __PARAMS((integer *,integer *,integer *,double *)); 
- extern void C2F(xclickGif)  __PARAMS((char *,integer *ibutton,integer *x1,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(loadfamilyGif)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(xclick_anyGif)  __PARAMS((char *,integer *ibutton,integer *x1,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(xgetmouseGif)  __PARAMS((char *,integer *ibutton,integer *x1,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(clearareaGif)  __PARAMS((char *,integer *,integer *,integer *w,integer *h,integer *,integer *,double *,double *,double *,double *)); 
- extern void C2F(getwindowposGif)  __PARAMS((integer *,integer *,integer *,double *)); 
- extern void C2F(setwindowposGif)  __PARAMS((integer *,integer *,integer *,integer *)); 
- extern void C2F(getwindowdimGif)  __PARAMS((integer *,integer *,integer *,double *)); 
- extern void C2F(setwindowdimGif)  __PARAMS((integer *,integer *,integer *,integer *)); 
- extern void C2F(setcurwinGif)  __PARAMS((integer *intnum,integer *,integer *,integer *)); 
- extern void C2F(getcurwinGif)  __PARAMS((integer *,integer *intnum,integer *,double *)); 
- extern void C2F(setclipGif)  __PARAMS((integer *,integer *,integer *w,integer *h)); 
- extern void C2F(unsetclipGif)  __PARAMS((integer *,integer *,integer *,integer *)); 
- extern void C2F(getclipGif)  __PARAMS((integer *,integer *,integer *,double *)); 
- extern void C2F(setabsourelGif)  __PARAMS((integer *num,integer *,integer *,integer *)); 
- extern void C2F(getabsourelGif)  __PARAMS((integer *,integer *num,integer *,double *)); 
- extern void C2F(setalufunctionGif)  __PARAMS((char *)); 
- extern void C2F(idfromnameGif)  __PARAMS((char *,integer *num)); 
- extern void C2F(setalufunction1Gif)  __PARAMS((integer *num,integer *,integer *,integer *)); 
- extern void C2F(getalufunctionGif)  __PARAMS((integer *,integer *value,integer *,double *)); 
- extern void C2F(setthicknessGif)  __PARAMS((integer *value,integer *,integer *,integer *)); 
- extern void C2F(getthicknessGif)  __PARAMS((integer *,integer *value,integer *,double *)); 
- extern void C2F(setpatternGif)  __PARAMS((integer *num,integer *,integer *,integer *)); 
- extern void C2F(getpatternGif)  __PARAMS((integer *,integer *num,integer *,double *)); 
- extern void C2F(getlastGif)  __PARAMS((integer *,integer *num,integer *,double *)); 
- extern void C2F(setdashGif)  __PARAMS((integer *value,integer *,integer *,integer *)); 
- extern void C2F(setdashstyleGif)  __PARAMS((integer *value,integer *x,integer *n)); 
- extern void C2F(getdashGif)  __PARAMS((integer *,integer *value,integer *,double *)); 
- extern void C2F(usecolorGif)  __PARAMS((integer *num,integer *,integer *,integer *)); 
- extern void C2F(getusecolorGif)  __PARAMS((integer *,integer *num,integer *,double *)); 
- extern void C2F(setcolormapGif)  __PARAMS((integer *,integer *,integer *,integer *,integer *,integer *,double *a)); 
- extern void C2F(set_cGif)  __PARAMS((integer i)); 
- extern void C2F(setbackgroundGif)  __PARAMS((integer *num,integer *,integer *,integer *)); 
- extern void C2F(getbackgroundGif)  __PARAMS((integer *,integer *num,integer *,double *)); 
- extern void C2F(setforegroundGif)  __PARAMS((integer *num,integer *,integer *,integer *)); 
- extern void C2F(getforegroundGif)  __PARAMS((integer *,integer *num,integer *,double *)); 
- extern void C2F(sethidden3dGif)  __PARAMS((integer *num,integer *,integer *,integer *)); 
- extern void C2F(gethidden3dGif)  __PARAMS((integer *,integer *num,integer *,double *)); 
- extern void C2F(semptyGif)  __PARAMS((integer *,integer *,integer *,integer *)); 
-       
-       /* periX11.c */
-
-#ifndef _MSC_VER 
-
-extern void SciClick __PARAMS((integer *ibutton,integer *x1,integer *yy1,integer *iflag,int getmouse,
-                      int dyn_men,int getrelease,char *str,integer * lstr));
-extern void fill_grid_rectangles __PARAMS(( integer *x,  integer *y,  double *z, integer n1, integer n2));
-extern void fill_grid_rectangles1 __PARAMS(( integer *x,  integer *y,  double *z, integer n1, integer n2));
-extern void C2F(getwindowdim) __PARAMS((integer *verbose, integer *x, integer *narg, double *dummy));
-extern int GetWinsMaxId __PARAMS((void));
-extern void SwitchWindow __PARAMS((integer *intnum));
-extern int C2F(sedeco)  __PARAMS((int *)); 
-extern void C2F(set_default_colormap)  __PARAMS((void)); 
-extern int get_pixel  __PARAMS((int i)); 
-extern int CheckColormap  __PARAMS((int *m)); 
-extern void get_r  __PARAMS((int i,float *r)); 
-extern void get_g  __PARAMS((int i,float *g)); 
-extern void get_b  __PARAMS((int i,float *b)); 
-extern void C2F(MissileGCget)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(MissileGCset)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(MissileGCGetorSet)  __PARAMS((char *,integer flag,integer *,integer *,integer *,integer *,integer *,integer *,integer *,double *)); 
-extern void C2F(displaystring)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *angle,double *,double *,double *)); 
-extern void C2F(DispStringAngle)  __PARAMS((integer *,integer *,char *,double *angle)); 
-extern void C2F(boundingbox)  __PARAMS((char *,integer *,integer *,integer *rect,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(drawline)  __PARAMS((integer *,integer *,integer *,integer *)); 
-/**  extern int XgcFreeColors  __PARAMS((struct BCG *gc));  **/
-extern void C2F(drawsegments)  __PARAMS((char *,integer *,integer *vy,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(drawarrows)  __PARAMS((char *,integer *,integer *vy,integer *,integer *as,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(drawrectangles)  __PARAMS((char *,integer *vects,integer *fillvect,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(drawrectangle)  __PARAMS((char *,integer *,integer *,integer *width,integer *height,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(fillrectangle)  __PARAMS((char *,integer *,integer *,integer *width,integer *height,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(fillarcs)  __PARAMS((char *,integer *vects,integer *fillvect,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(drawarcs)  __PARAMS((char *,integer *vects,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(drawarc)  __PARAMS((char *,integer *,integer *,integer *width,integer *height,integer *angle1,integer *angle2,double *,double *,double *,double *)); 
-extern void C2F(fillarc)  __PARAMS((char *,integer *,integer *,integer *width,integer *height,integer *angle1,integer *angle2,double *,double *,double *,double *)); 
-extern void C2F(drawpolylines)  __PARAMS((char *,integer *vectsx,integer *vectsy,integer *rawvect,integer *,integer *p,integer *,double *,double *,double *,double *)); 
-extern void C2F(fillpolylines)  __PARAMS((char *,integer *vectsx,integer *vectsy,integer *fillvect,integer *,integer *p,integer *,double *,double *,double *,double *)); 
-extern void C2F(drawpolyline)  __PARAMS((char *,integer *,integer *,integer *vy,integer *closeflag,integer *,integer *,double *,double *,double *,double *)); 
-extern void CPixmapResize  __PARAMS((int x,int y)); 
-extern void C2F(fillpolyline)  __PARAMS((char *,integer *,integer *,integer *vy,integer *closeflag,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(drawpolymark)  __PARAMS((char *,integer *,integer *,integer *vy,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void DeleteSGWin  __PARAMS((integer intnum)); 
-extern void DeleteWindowToList  __PARAMS((integer num)); 
-extern void C2F(getwins)  __PARAMS((integer *Num,integer *,integer *)); 
-extern void set_c  __PARAMS((integer i)); 
-extern void C2F(initgraphic)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void CPixmapResize1  __PARAMS((void)); 
-extern void C2F(xinfo)  __PARAMS((char *message,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(xselgraphic)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(drawaxis)  __PARAMS((char *,integer *,integer *nsteps,integer *,integer *initpoint,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(xendgraphic)  __PARAMS((void)); 
-extern void C2F(displaynumbers)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(xend)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(bitmap)  __PARAMS((char *,integer,integer)); 
-extern void C2F(loadfamily)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(clearwindow)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern int C2F(CurSymbXOffset)  __PARAMS((void)); 
-extern int C2F(CurSymbYOffset)  __PARAMS((void)); 
-extern int C2F(store_points)  __PARAMS((integer,integer *,integer *vy,integer onemore)); 
-extern int C2F(AllocVectorStorage)  __PARAMS((void)); 
-extern void set_clip_box __PARAMS((integer xxleft,integer xxright,integer yybot,integer yytop)); 
-extern void clip_line  __PARAMS((integer,integer,integer ,integer,integer *,integer *,integer *,integer *,integer *)); 
-extern void C2F(xclick)  __PARAMS((char *,integer *ibutton,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(xclick_any)  __PARAMS((char *,integer *ibutton,integer *,integer *,integer *iwin,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(xgetmouse_test)  __PARAMS((char *,integer *ibutton,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(xgetmouse)  __PARAMS((char *,integer *ibutton,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(cleararea)  __PARAMS((char *,integer *,integer *,integer *w,integer *h,integer *,integer *,double *,double *,double *,double *)); 
-extern void C2F(Recenter_GW)  __PARAMS((void)); 
-extern void getcolordef  __PARAMS((integer *));
-extern void setcolordef  __PARAMS((integer ));
-extern void wininfo  __PARAMS((char *fmt,...));
-
-#else 
-
-/*  periWin.c */
-
-extern void SciClick __PARAMS((integer *ibutton,integer *x1,integer *yy1,integer *iflag,int getmouse,int dyn_men,int release,char *str,integer * lstr));
-extern void SciG_Font_Printer(int scale);
-extern void SciG_Font(void) ;
-extern void CleanFonts();
-extern void SciMouseCapture();
-extern void SciMouseRelease();
-extern void SetWinhdc  __PARAMS((void));  
-extern int MaybeSetWinhdc  __PARAMS((void));  
-extern void ReleaseWinHdc  __PARAMS((void));  
-/**   extern void SetGHdc  __PARAMS((HDC lhdc,int width,int height));  **/
-/**  extern int XgcAllocColors  __PARAMS((struct BCG *gc,int m));   **/
-/**   extern int XgcFreeColors  __PARAMS((struct BCG *gc));  **/
-  extern void C2F(pixmapclear)  __PARAMS((integer *,integer *,integer *,integer *));  
-  extern void C2F(show)  __PARAMS((integer *,integer *,integer *,integer *));  
-  extern void CPixmapResize  __PARAMS((int x,int y));  
-  extern void CPixmapResize1  __PARAMS((void));  
-  extern void C2F(xselgraphic)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *));  
-  extern void C2F(xendgraphic)  __PARAMS((void));  
-  extern void C2F(xend)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *));  
-  extern void C2F(clearwindow)  __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *));  
-  extern void C2F(xclick)  __PARAMS((char *,integer *ibutton,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *));  
-  extern void C2F(xclick_any)  __PARAMS((char *,integer *ibutton,integer *,integer *,integer *iwin,integer *,integer *,double *,double *,double *,double *));  
-  extern void C2F(xgetmouse)  __PARAMS((char *,integer *ibutton,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *));  
-  extern void C2F(cleararea)  __PARAMS((char *,integer *,integer *,integer *w,integer *h,integer *,integer *,double *,double *,double *,double *));  
-  extern void C2F(getwindowpos)  __PARAMS((integer *,integer *,integer *,double *));  
-  extern void C2F(setwindowpos)  __PARAMS((integer *,integer *,integer *,integer *));  
-  extern void C2F(getwindowdim)  __PARAMS((integer *,integer *,integer *,double *));  
-  extern void C2F(setwindowdim)  __PARAMS((integer *,integer *,integer *,integer *));  
-  extern void C2F(setcurwin)  __PARAMS((integer *intnum,integer *,integer *,integer *));  
-  extern int SwitchWindow  __PARAMS((integer *intnum));  
-  extern void C2F(getcurwin) __PARAMS((integer *,integer *intnum,integer *,double *));  
-  extern void C2F(setclip) __PARAMS((integer *,integer *,integer *w,integer *h));  
-  extern void C2F(unsetclip) __PARAMS((integer *,integer *,integer *,integer *));  
-  extern void C2F(getclip) __PARAMS((integer *,integer *,integer *,double *));  
-  extern void C2F(setabsourel) __PARAMS((integer *num,integer *,integer *,integer *));  
-  extern void C2F(getabsourel) __PARAMS((integer *,integer *num,integer *,double *));  
-  extern void C2F(setalufunction) __PARAMS((char *));  
-  extern void C2F(setalufunction1) __PARAMS((integer *num,integer *,integer *,integer *));  
-  extern void C2F(getalufunction) __PARAMS((integer *,integer *value,integer *,double *));  
-  extern void C2F(setthickness) __PARAMS((integer *value,integer *,integer *,integer *));  
-  extern void C2F(getthickness) __PARAMS((integer *,integer *value,integer *,double *));  
-  extern void C2F(CreatePatterns) __PARAMS((void));  
-  extern void C2F(setpattern) __PARAMS((integer *num,integer *,integer *,integer *));  
-  extern void C2F(getpattern) __PARAMS((integer *,integer *num,integer *,double *));  
-  extern void C2F(getlast) __PARAMS((integer *,integer *num,integer *,double *));  
-  extern void C2F(setdash) __PARAMS((integer *value,integer *,integer *,integer *));  
-  extern void C2F(getdash) __PARAMS((integer *,integer *value,integer *,double *));  
-  extern void C2F(usecolor) __PARAMS((integer *num,integer *,integer *,integer *));  
-  extern void C2F(getusecolor) __PARAMS((integer *,integer *num,integer *,double *));  
-  extern void C2F(setpixmapOn) __PARAMS((integer *num,integer *,integer *,integer *));  
-  extern void C2F(getpixmapOn) __PARAMS((integer *,integer *value,integer *,double *));  
-  extern int C2F(sedeco) __PARAMS((int *));  
-  extern void set_default_colormap  __PARAMS((void));  
-  extern void C2F(setcolormap) __PARAMS((integer *,integer *,integer *,integer *,integer *,integer *,double *a));  
-  extern void C2F(getcolormap) __PARAMS((integer *,integer *num,integer *,double *val));  
-  extern void C2F(setbackground) __PARAMS((integer *num,integer *,integer *,integer *));  
-  extern void C2F(getbackground) __PARAMS((integer *,integer *num,integer *,double *));  
-  extern void C2F(setforeground) __PARAMS((integer *num,integer *,integer *,integer *));  
-  extern void C2F(getforeground) __PARAMS((integer *,integer *num,integer *,double *));  
-  extern void C2F(sethidden3d) __PARAMS((integer *num,integer *,integer *,integer *));  
-  extern void C2F(gethidden3d) __PARAMS((integer *,integer *num,integer *,double *));  
-  extern int CheckColormap  __PARAMS((int *m));  
-  extern void get_r  __PARAMS((int i,float *r));  
-  extern void get_g  __PARAMS((int i,float *g));  
-  extern void get_b  __PARAMS((int i,float *b));  
-  extern void C2F(sempty) __PARAMS((integer *,integer *,integer *,integer *));  
-  extern void C2F(gempty) __PARAMS((integer *,integer *,integer *,double *));  
-  extern void C2F(MissileGCget) __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *));  
-  extern void C2F(MissileGCset) __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *));  
-  extern void C2F(MissileGCGetorSet) __PARAMS((char *,integer flag,integer *,integer *,integer *,integer *,integer *,integer *,integer *,double *));  
-  extern void C2F(displaystring) __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *angle,double *,double *,double *));  
-  extern void C2F(DispStringAngle) __PARAMS((integer *,integer *y0,char *,double *angle));  
-  extern void C2F(boundingbox) __PARAMS((char *,integer *,integer *,integer *rect,integer *,integer *,integer *,double *,double *,double *,double *));  
-  extern void C2F(drawline) __PARAMS((integer *,integer *,integer *,integer *));  
-  extern void C2F(drawsegments) __PARAMS((char *,integer *,integer *vy,integer *,integer *,integer *,integer *,double *,double *,double *,double *));  
-  extern void C2F(drawarrows) __PARAMS((char *,integer *,integer *vy,integer *,integer *as,integer *,integer *,double *,double *,double *,double *));  
-  extern void C2F(drawrectangles) __PARAMS((char *,integer *vects,integer *fillvect,integer *,integer *,integer *,integer *,double *,double *,double *,double *));  
-  extern void C2F(drawrectangle) __PARAMS((char *,integer *,integer *,integer *width,integer *height,integer *,integer *,double *,double *,double *,double *));  
-  extern void C2F(fillrectangle) __PARAMS((char *,integer *,integer *,integer *width,integer *height,integer *,integer *,double *,double *,double *,double *));  
-  extern void C2F(fillarcs) __PARAMS((char *,integer *vects,integer *fillvect,integer *,integer *,integer *,integer *,double *,double *,double *,double *));  
-  extern void C2F(drawarcs) __PARAMS((char *,integer *vects,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *));  
-  extern void C2F(drawarc) __PARAMS((char *,integer *,integer *,integer *width,integer *height,integer *angle1,integer *angle2,double *,double *,double *,double *));  
-  extern void C2F(fillarc) __PARAMS((char *,integer *,integer *,integer *width,integer *height,integer *angle1,integer *angle2,double *,double *,double *,double *));  
-  extern void C2F(drawpolylines) __PARAMS((char *,integer *vectsx,integer *vectsy,integer *rawvect,integer *,integer *p,integer *,double *,double *,double *,double *));  
-  extern void C2F(fillpolylines) __PARAMS((char *,integer *vectsx,integer *vectsy,integer *fillvect,integer *,integer *p,integer *,double *,double *,double *,double *));  
-  extern void C2F(drawpolyline) __PARAMS((char *,integer *,integer *,integer *vy,integer *closeflag,integer *,integer *,double *,double *,double *,double *));  
-  extern void C2F(fillpolyline) __PARAMS((char *,integer *,integer *,integer *vy,integer *closeflag,integer *,integer *,double *,double *,double *,double *));  
-  extern void C2F(drawpolymark) __PARAMS((char *,integer *,integer *,integer *vy,integer *,integer *,integer *,double *,double *,double *,double *));  
-/**  extern struct BCG *AddNewWindowToList  __PARAMS((void));  **/
-/**  extern struct BCG *AddNewWindow  __PARAMS((WindowList **listptr));  **/
-  extern void DeleteSGWin  __PARAMS((integer intnum));  
-  extern void DeleteWindowToList  __PARAMS((integer num));  
-  extern void C2F(getwins) __PARAMS((integer *,integer *,integer *));  
-  extern void set_c  __PARAMS((integer i));  
-  extern void C2F(initgraphic) __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *));  
-  extern void C2F(xinfo) __PARAMS((char *message,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *));  
-  extern void wininfo  __PARAMS((char *fmt,...));
-  extern void getcolordef  __PARAMS((integer *creenc));  
-  extern void setcolordef  __PARAMS((integer screenc));  
-  extern void ResetScilabXgc  __PARAMS((void));  
-  extern void C2F(drawaxis) __PARAMS((char *,integer *,integer *nsteps,integer *,integer *initpoint,integer *,integer *,double *,double *,double *,double *));  
-  extern void C2F(displaynumbers) __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *));  
-  extern void C2F(bitmap) __PARAMS((char *,integer,integer));  
-  extern void C2F(xsetfont) __PARAMS((integer *,integer *,integer *,integer *));  
-  extern void C2F(xgetfont) __PARAMS((integer *,integer *,integer *,double *));  
-  extern void C2F(xsetmark) __PARAMS((integer *,integer *,integer *,integer *));  
-  extern void C2F(xgetmark) __PARAMS((integer *,integer *,integer *,double *));  
-  extern void C2F(loadfamily) __PARAMS((char *,integer *,integer *,integer *,integer *,integer *,integer *,double *,double *,double *,double *));  
-/**   extern void SciMakeFont  __PARAMS((char *,int size,HFONT *hfont));  **/
-  extern int C2F(CurSymbXOffset) __PARAMS((void));  
-  extern int C2F(CurSymbYOffset) __PARAMS((void));  
-  extern int C2F(store_points) __PARAMS((integer,integer *,integer *vy,integer onemore));  
-  extern int C2F(AllocVectorStorage) __PARAMS((void));  
-  extern void set_clip_box  __PARAMS((integer xxleft,integer xxright,integer yybot,integer yytop));  
-  extern void clip_line  __PARAMS((integer,integer,integer ,integer,integer *,integer *,integer *,integer *, integer *));  
-
-
-
-
-#endif /* ifndef _MSC_VER */
-
-extern integer first_in __PARAMS(( integer,integer,integer *,integer*));
-extern integer first_out __PARAMS(( integer,integer,integer *,integer*));
-
-
-
-#endif /** SCIG_PROTO **/
-
diff --git a/scilab/modules/graphics/includes/GrayPlot.h b/scilab/modules/graphics/includes/GrayPlot.h
new file mode 100644 (file)
index 0000000..306e03c
--- /dev/null
@@ -0,0 +1,42 @@
+/*------------------------------------------------------------------------*/
+/* file: GrayPlot.h                                                       */
+/* Copyright INRIA 2007                                                   */
+/* Authors : Jean-Baptiste Silvy                                          */
+/* desc : Functions to compute and draw a grayplot                        */
+/*------------------------------------------------------------------------*/
+
+#ifndef _GRAY_PLOT_H_
+#define _GRAY_PLOT_H_
+
+/**
+ * - z is a (n1,n2) matrix 
+ * - x is a (1,n1) matrix 
+ * - y is a (1,n2) matrix 
+ * - x,y,z are stored as one dimensionnal array in C 
+ *
+ *  z : is the value of a function on the grid defined by x,y 
+ *  on each rectangle the average value of z is computed 
+ *  and [zmin,zmax] is linearly remapped to the [colormin,colormap]
+ *  values of colors in the current colormap 
+ *  the color associated to zmoy is used for filling a specific rectangle 
+ */
+int C2F(xgray)(double *x, double *y, double *z, integer *n1, integer *n2, char *strflag, double *brect, integer *aaint, BOOL flagNax, long int l1) ;
+
+
+/**
+ * Matplot subroutine
+ *  z : of size n1*n2 
+ *  the z value is interpreted as a color number inside the current colormap
+ *  z[i,j] is used as the color of a square [i-0.5,i+0.5] [j-0.5,j+0.5]
+ */
+int C2F(xgray1)(double *z, integer *n1, integer *n2, char *strflag, double *brect, integer *aaint, BOOL flagNax, long int l1) ;
+
+
+/**
+ * like xgray1 : 
+ * but xrect here give the rectangle in which the 
+ * grayplot is to be drawn using the current scale
+ */
+int C2F(xgray2)(double *z, integer *n1, integer *n2, double *xrect) ;
+
+#endif /* _GRAY_PLOT_H_ */
index 15d6bcd..e9e5176 100644 (file)
 
 int C2F(box3d)(double *xbox, double *ybox, double *zbox) ;
 
-void SetEch3d(double *xbox, double *ybox, double *zbox, double *bbox, double *teta, double *alpha) ;
-
 void DrawAxis(double *xbox, double *ybox, integer *Indices, integer style) ;
 
 void Convex_Box(double *xbox, double *ybox, integer *InsideU, integer *InsideD, char *legend, integer *flag, double *bbox) ;
 
 void AxesStrings(integer axflag, integer *ixbox, integer *iybox, integer *xind, char *legend, double *bbox) ;
 
-int  triangleSort(integer *polyxin, integer *polyyin, integer *fillin, integer *polyx, integer *polyy, integer *fill);
+int triangleSort(integer *polyxin, integer *polyyin, integer *fillin, integer *polyx, integer *polyy, integer *fill);
 
 int scilab_shade(integer *polyx, integer *polyy, integer *fill, integer polysize, integer flag) ;
 
+void BBoxToval(double *x, double *y, double *z, integer ind, double bbox[6] ) ;
+
 #endif /* _PLO3D_H_ */
index dfd1691..de22381 100644 (file)
@@ -190,6 +190,38 @@ void Plo2d2RealToPixel(integer *n1, integer *n2, double *x, double *y, integer *
 void Plo2d3RealToPixel(integer *n1, integer *n2, double *x, double *y, integer *xm, integer *ym, char *xf) ;
 void Plo2d4RealToPixel(integer *n1, integer *n2, double *x, double *y, integer *xm, integer *ym, char *xf) ;
 
+int C2F(echelle2d)( double    x[]  ,
+                    double    y[]  ,
+                    integer   x1[] ,
+                    integer   yy1[],
+                    integer * n1   ,
+                    integer * n2   ,
+                    char      dir[],
+                    integer   lstr ) ;
+
+void C2F(echelle2dl)( double    x[]  ,
+                      double    y[]  ,
+                      integer   x1[] ,
+                      integer   yy1[],
+                      integer * n1   ,
+                      integer * n2   ,
+                      char    * dir   ) ;
+
+void C2F(rect2d)( double x[], integer x1[], integer * n, char * dir ) ;
+void C2F(ellipse2d)( double x[], integer x1[], integer * n, char * dir) ;
+void C2F(axis2d)( double  * alpha     ,
+                  double  * initpoint ,
+                  double  * size      ,
+                  integer * initpoint1,
+                  double  * size1       ) ;
+
+int get_window_scale( integer i, double * subwin ) ;
+void del_window_scale( integer i ) ;
+
+void Cscale2default( void ) ;
+
+void set_window_scale_with_default( int i ) ;
+
 #endif  /* _SCI_ECH */
 
 
index 565be9c..f59177f 100644 (file)
@@ -18,13 +18,17 @@ int C2F(dr)(char x0[],char x1[],integer *x2,integer *x3,integer *x4,integer *x5,
             integer *x7,double *dx1,double *dx2,double *dx3,double *dx4,
             integer lx0, integer lx1) ;
 
+int C2F(xsetg)(char * str,char * str1,integer lx0,integer lx1) ;
 int C2F(xgetg)( char * str, char * str1, integer * len,integer  lx0,integer lx1) ;
 
+char GetDriver( void ) ;
 void GetDriver1(char *str, integer *v2,integer * v3,integer * v4, integer *v5,integer * v6,
                 integer * v7,double * dv1,double * dv2,double * dv3,double * dv4) ;
 
 int GetDriverId( void ) ;
 
+char * getFPF(void) ;
+
 void C2F(SetDriver)(char *x0, integer *v2,integer * v3,integer * v4, integer *v5,integer * v6, integer * v7,double * dv1,double * dv2,double * dv3,double * dv4);
 
 /**
index f7c42d1..189a542 100644 (file)
@@ -8,7 +8,6 @@
 #ifndef __SCI_CLIPPING__
 #define __SCI_CLIPPING__
 
-#include "Graphics.h"
 #include "ObjectStructure.h"
 #include "PloEch.h"
 
@@ -26,8 +25,13 @@ typedef struct
 SClipRegion ;
 
 /*----------------------------------------------------------------------------------------*/
+/**
+ * To retrieve the current clipping region
+ */
+SClipRegion getClipRegion( struct BCG * scilabXGC ) ;
+/*----------------------------------------------------------------------------------------*/
 /* 
- * @memo use for drawing precomputing clipping when drawing polygons
+ * use for drawing precomputing clipping when drawing polygons
  * Test a single point to be within the xleft,xright,ybot,ytop bbox.
  * Sets the returned integers 4 l.s.b. as follows:
  * bit 0 if to the left of xleft.
index 374126f..fde1e30 100644 (file)
 #define M_PI 3.14159265358979323846 
 #endif
 
+double Mini(double *vect, integer n) ;
+
+double Maxi(double *vect,integer n) ;
 
 extern double exp10 __PARAMS((double));
 
index 35d3968..c308387 100644 (file)
@@ -49,6 +49,8 @@ static BOOL ScilabGCXfig_is_initialized = FALSE;
  extern void  C2F(loadfamilyXfig)();
  extern void  C2F(queryfamilyXfig)() ;
 
+void C2F(getwindowdimXfig)(integer *verbose, integer *x, integer *narg, double *dummy) ;
+
 void C2F(set_dash_or_color_Xfig)(integer *value, integer *v2, integer *v3, integer *v4);
 
 void C2F(set_dash_and_color_Xfig)(integer *value, integer *v2, integer *v3, integer *v4);
index d817c44..e1910c3 100644 (file)
  extern void  C2F(drawarrowsGif)(char *str, integer *vx, integer *vy, integer *n, integer *as, integer *style, integer *iflag, double *dv1, double *dv2, double *dv3, double *dv4); 
  extern void  C2F(loadfamilyGif)(char *name, integer *j, integer *v3, integer *v4, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4);
  extern void  C2F(queryfamilyGif)(char *name, integer *j, integer *v3, integer *v4, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4);
+
+void InitScilabGCGif(integer *v1, integer *v2, integer *v3, integer *v4) ;
+
+void C2F(setthicknessGif)(integer *value, integer *v2, integer *v3, integer *v4) ;
+void C2F(setalufunctionGif)(char *string) ;
+void C2F(unsetclipGif)(integer *v1, integer *v2, integer *v3, integer *v4) ;
+void C2F(setpatternGif)(integer *num, integer *v2, integer *v3, integer *v4) ;
+void C2F(setdashGif)(integer *value, integer *v2, integer *v3, integer *v4) ;
+void C2F(sethidden3dGif)(integer *num, integer *v2, integer *v3, integer *v4) ;
+void C2F(usecolorGif)(integer *num, integer *v2, integer *v3, integer *v4) ;
+
 #endif /* __PERIGIF_H__ */
 
 
index 6d62e1a..0a073ac 100644 (file)
@@ -62,6 +62,8 @@ void C2F(getcolormapPos)(integer *v1, integer *v2, integer *v3, double *val);
 
 void C2F(setwwhowPos)(integer *verbose, integer *v2, integer *v3, integer *v4);
 
+void InitScilabGCPos(integer *v1, integer *v2, integer *v3, integer *v4) ;
+
 void setposfig( integer * i, integer * j ) ;
 
 #endif /*__PERIPOS_H__*/
index 803a8ba..aaae576 100644 (file)
  extern void  C2F(queryfamily)();
  extern void C2F(xinfo)();
  
+/** set and get the number of the background or foreground */
+void C2F(setforeground)( integer * num, integer * v2, integer * v3, integer * v4) ;
+void C2F(setbackground)( integer * num, integer * v2, integer * v3, integer * v4) ;
+void C2F(xsetfont)( integer * fontid, integer * fontsize, integer * v3, integer * v4 ) ;
+void C2F(xgetfont)( integer * verbose, integer * font, integer * nargs, double * dummy) ;
+void C2F(xsetmark)( integer * number, integer * size, integer * v3, integer * v4) ;
+void C2F(xgetmark)( integer * verbose,  integer *symb, integer * narg, double * dummy) ;
+
  extern void C2F(getwins)( integer * Num, integer Ids[] , integer * flag) ;
 
  extern void getcolordef( integer * screenc ) ;
@@ -69,6 +77,63 @@ static int flag_DO; /* F.Leray 16.02.04 flag global pour la fonction recursive D
 #endif
 /*-------------------------------------------------------------------------------*/
 
+void set_clip_box( integer xxleft ,
+                   integer xxright,
+                   integer yybot  ,
+                   integer yytop  ) ;
+
+void clip_line( integer   x1  ,
+                integer   yy1 ,
+                integer   x2  ,
+                integer   y2  ,
+                integer * x1n ,
+                integer * yy1n,
+                integer * x2n ,
+                integer * y2n ,
+                integer * flag ) ;
+
+
+int CheckColormap( int * m ) ;
+
+void get_r( int i, float * r ) ;
+void get_g( int i, float * g ) ;
+void get_b( int i, float * b ) ;
+
+
+void C2F(getwindowdim)( integer * verbose, integer * x, integer * narg, double * dummy ) ;
+
+int C2F(sedeco)( int * flag ) ;
+
+int C2F(store_points)( integer n, integer * vx, integer * vy, integer onemore) ;
+int C2F(AllocVectorStorage)( void ) ;
+
+/*--------------------------------------------------------------------------------------------*/
+
+void SetWinhdc( void ) ;
+
+void SciMouseCapture( void ) ;
+void SciMouseRelease( void ) ;
+
+void DeleteSGWin( integer intnum ) ;
+
+void CPixmapResize1( void ) ;
+
+void SciG_Font_Printer(int scale) ;
+
+/**
+ * Utilise le ScilabXgc courant pour reinitialiser le gc XWindow
+ * cela est utilis'e quand on change de fenetre graphique
+ */
+
+void ResetScilabXgc( void ) ;
+void SciG_Font(void)  ;
+void wininfo(char *fmt,...) ;
+
+void C2F(DispStringAngle)( integer * x0, integer * yy0, char * string, double * angle) ;
+
+/*--------------------------------------------------------------------------------------------*/
+
+
 #endif /* __PERIWIN_H__ */
 
 
index 92d841e..30c4272 100644 (file)
 
 void deletePoints( void ) ;
 
+void set_clip_box( integer xxleft ,
+                  integer xxright,
+                  integer yybot  ,
+                  integer yytop  ) ;
+
+void clip_line( integer   x1  ,
+               integer   yy1 ,
+               integer   x2  ,
+               integer   y2  ,
+               integer * x1n ,
+               integer * yy1n,
+               integer * x2n ,
+               integer * y2n ,
+               integer * flag ) ;
+
+int CheckColormap( int * m ) ;
+
+void get_r( int i, float * r ) ;
+void get_g( int i, float * g ) ;
+void get_b( int i, float * b ) ;
+
+void C2F(getwindowdim)( integer * verbose, integer * x, integer * narg, double * dummy ) ;
+
+int C2F(sedeco)( int * flag ) ;
 
 /*---------------------END------------------------------*/
 #endif /* __PERIX11_H__ */
index 15dfddf..68f9262 100644 (file)
@@ -15,7 +15,6 @@
 #include "DefaultCommandArg.h"
 #include "Champ.h"
 #include "GetProperty.h"
-#include "Graphics.h"
 
 /*-----------------------------------------------------------------------------------*/
 int sci_champ (char *fname,unsigned long fname_len)
index 603db1e..6e2599f 100644 (file)
@@ -8,8 +8,9 @@
 #include <string.h>
 
 #include "sci_contour2di.h"
-#include "Graphics.h"
 #include "GetCommandArg.h"
+#include "Scierror.h"
+#include "Contour.h"
 
 /*-----------------------------------------------------------------------------------*/
 int sci_contour2di( char * fname, unsigned long fname_len )
index 13bea78..becca5a 100644 (file)
@@ -9,8 +9,8 @@
 
 #include "machine.h"
 #include "stack-c.h"
-#include "Graphics.h"
 #include "sci_demo.h"
+#include "sciprint.h"
 
 int sci_demo( char * fname, char * code, int * flagx )
 {
index d3f6be4..3e26e50 100644 (file)
@@ -9,7 +9,6 @@
 #include "GetProperty.h"
 #include "SetProperty.h"
 #include "DrawObjects.h"
-#include "Graphics.h"
 #include "BuildObjects.h"
 #include "gw_graphics.h"
 #include "HandleManagement.h"
index 8c6a1e5..32640a4 100644 (file)
@@ -11,7 +11,6 @@
 #include "BuildObjects.h"
 #include "gw_graphics.h"
 #include "DestroyObjects.h"
-#include "Graphics.h"
 #include "GetProperty.h"
 #include "DefaultCommandArg.h"
 #include "sciCall.h"
index 568c1fb..df43281 100644 (file)
@@ -13,7 +13,6 @@
 #include "gw_graphics.h"
 #include "DestroyObjects.h"
 #include "GetProperty.h"
-#include "Graphics.h"
 #include "sciCall.h"
 
 /*-----------------------------------------------------------------------------------*/
index 07dfea4..b62eb66 100644 (file)
@@ -8,7 +8,6 @@
 #include "sci_param3d.h"
 #include "sci_demo.h"
 #include "GetCommandArg.h"
-#include "Graphics.h"
 #include "BuildObjects.h"
 #include "gw_graphics.h"
 #include "DestroyObjects.h"
index cc66c24..8a929e9 100644 (file)
@@ -7,7 +7,6 @@
 #include "sci_param3d1.h"
 #include "sci_demo.h"
 #include "GetCommandArg.h"
-#include "Graphics.h"
 #include "BuildObjects.h"
 #include "gw_graphics.h"
 #include "DestroyObjects.h"
index 5e17cf8..8e7746e 100644 (file)
@@ -11,7 +11,6 @@
 #include "GetCommandArg.h"
 #include "machine.h"
 #include "stack-c.h"
-#include "Graphics.h"
 #include "BuildObjects.h"
 #include "gw_graphics.h"
 #include "DestroyObjects.h"
index ee29dd6..2909b1a 100644 (file)
@@ -13,7 +13,6 @@
 #include "gw_graphics.h"
 #include "DestroyObjects.h"
 #include "DefaultCommandArg.h"
-#include "Graphics.h"
 #include "GetProperty.h"
 #include "sciCall.h"
 
index cd26bcc..2f8cfef 100644 (file)
@@ -6,7 +6,6 @@
 /*------------------------------------------------------------------------*/
 
 #include "sci_xarcs.h"
-#include "Graphics.h"
 #include "BuildObjects.h"
 #include "gw_graphics.h"
 #include "SetProperty.h"
index e44b047..f2dd5dd 100644 (file)
@@ -6,7 +6,6 @@
 /*------------------------------------------------------------------------*/
 
 #include "sci_xarrows.h"
-#include "Graphics.h"
 #include "BuildObjects.h"
 #include "gw_graphics.h"
 #include "sciCall.h"
index 795389a..84d639a 100644 (file)
@@ -6,7 +6,6 @@
 /*------------------------------------------------------------------------*/
 
 #include "sci_xchange.h"
-#include "Graphics.h"
 #include "stack-c.h"
 #include "BuildObjects.h"
 #include "gw_graphics.h"
index 2bfeaf8..5bd8be1 100644 (file)
@@ -9,7 +9,6 @@
 
 #include "sci_xpoly.h"
 #include "stack-c.h"
-#include "Graphics.h"
 #include "sciCall.h"
 #include "DrawObjects.h"
 #include "GetProperty.h"
index fab7272..0da4a4f 100644 (file)
@@ -7,7 +7,6 @@
 
 #include "sci_xpoly.h"
 #include "stack-c.h"
-#include "Graphics.h"
 #include "sciCall.h"
 #include "DrawObjects.h"
 #include "GetProperty.h"
index dbc4f18..c8f4a16 100644 (file)
@@ -19,7 +19,7 @@
 #include "DrawObjects.h"
 #include "InitObjects.h"
 #include "XsetXgetParameters.h"
-#include "Graphics.h"
+#include "periScreen.h"
 
 /*-----------------------------------------------------------------------------------*/
 int sci_xset( char *fname, unsigned long fname_len )
index a01b02a..d101d74 100644 (file)
@@ -8,13 +8,14 @@
 #include <string.h>
 
 #include "math_graphics.h"
-#include "Graphics.h" 
 #include "GetProperty.h"
 #include "SetProperty.h"
 #include "DrawObjects.h"
 #include "Xcall1.h"
 #include "WindowList.h"
 #include "MALLOC.h"
+#include "Xcall1.h"
+#include "sciprint.h"
 
 extern int xinitxend_flag;
 
@@ -38,6 +39,10 @@ extern int WithBackingStore();
 #endif
 static int scig_buzy = 0;
 
+int I3dRotation(void) ;
+
+typedef int (*Scig_handler) __PARAMS((int));
+
 void reset_scig_handler(void);
 int scig_handler_none(int win_num);
 
@@ -52,17 +57,6 @@ int scig_handler_none(int win_num) {
 
 Scig_handler scig_handler = scig_handler_none;
 
-Scig_handler set_scig_handler(Scig_handler f)
-{
-  Scig_handler old = scig_handler;
-  scig_handler = f;
-  return old;
-}
-
-void reset_scig_handler(void)
-{
-  scig_handler = scig_handler_none;
-}
 
 /********************************************************
  * Basic Replay : redraw recorded graphics 
@@ -110,112 +104,7 @@ void scig_replay(integer win_num)
 }
 
 
-/********************************************************
- * Basic Replay : expose graphics i.e 
- * if we have a pixmap we can perform a wshow 
- * else we perform a sgig_replay 
- ********************************************************/
-
-void scig_expose(integer win_num)
-{
-  integer verb=0,cur,pix,na,backing;
-  char name[4];
-  if ( scig_buzy  == 1 ) return ;
-  scig_buzy =1;
-  GetDriver1(name,PI0,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0);
-  C2F(dr)("xget","window",&verb,&cur,&na,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
-  C2F(dr)("xset","window",&win_num,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-  C2F(dr)("xget","pixmap",&verb,&pix,&na,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
-
-#if defined(_MSC_VER)
-  backing = 0;
-#else
-  backing = WithBackingStore();
-#endif
-  if (backing) 
-    {
-      /* only used whith X11 were pixmap mode can be used for backing store 
-       * we are here in a case where the pixmap is used for backing store 
-       */
-      C2F(dr)("xset","wshow",PI0,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);    
-    }
-  else 
-    {
-      if (pix == 0) 
-       {
-         if ( (GetDriver()) != 'R') 
-           C2F(SetDriver)("Rec",PI0,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0);
-         C2F(dr)("xclear","v",PI0,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
-         sciRedrawFigure();
-         C2F(dr)("xset","wshow",PI0,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-       }
-      else
-       {
-         C2F(dr)("xset","wshow",PI0,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);    
-       }
-    }
-  C2F(dr)("xset","window",&cur,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-  C2F(dr)("xsetdr",name, PI0, PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-  scig_buzy = 0;
-}
-
-/********************************************************
- * Redraw graphic window win_num  after resizing 
- ********************************************************/
-
-void scig_resize(integer win_num)
-{
-  integer verb=0,cur,na,pix,backing;
-  char name[4];
-  if ( scig_buzy  == 1 ) return ;
-  scig_buzy =1;
-  GetDriver1(name,PI0,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0);
-  if ( (GetDriver()) !='R') 
-    C2F(SetDriver)("Rec",PI0,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0);
-  C2F(dr)("xget","window",&verb,&cur,&na,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
-  C2F(dr)("xset","window",&win_num,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-  C2F(dr)("xget","pixmap",&verb,&pix,&na,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
-  CPixmapResize1();
-  C2F(dr)("xclear","v",PI0,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);    
-#if defined(_MSC_VER)
-  backing = 0;
-#else
-  backing = WithBackingStore();
-#endif
-  sciRedrawFigure();
-  if (backing && pix!=1 ) C2F(dr)("xset","wshow",PI0,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-
-  C2F(dr)("xset","window",&cur,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-  C2F(dr)("xsetdr",name, PI0, PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-  scig_buzy = 0;
-}
-
-/********************************************************
- * Just resize a pixmap (win95 only)
- ********************************************************/
-
-void scig_resize_pixmap(integer win_num)
-{
-  integer verb=0,cur,na;
-  char name[4];
-  if ( scig_buzy  == 1 ) return ;
-  scig_buzy =1;
-  GetDriver1(name,PI0,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0);
-  C2F(SetDriver)("Int",PI0,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0);
-  C2F(dr)("xget","window",&verb,&cur,&na,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
-  C2F(dr)("xset","window",&win_num,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-  CPixmapResize1();
-  C2F(dr)("xset","window",&cur,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-  C2F(dr)("xsetdr",name, PI0, PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-  scig_buzy = 0;
-}
-
-
-/********************************************************
- * clear window 
- ********************************************************/
-
-void  scig_erase(integer win_num)
+void scig_erase(integer win_num)
 {
   integer verb=0,cur,na;
   char name[4];
@@ -236,10 +125,6 @@ void  scig_erase(integer win_num)
 
 
 
-/*******************************************************
- * 2D Zoom 
- ******************************************************/
-
 int scig_2dzoom(integer win_num)
 {
   char name[4];
@@ -261,12 +146,7 @@ int scig_2dzoom(integer win_num)
   return ret;
 }
 
-
-/*******************************************************
- * Unzoom function 
- ******************************************************/
-
-void   scig_unzoom(integer win_num)
+void scig_unzoom(integer win_num)
 {
   integer verb=0,cur,na;
   char name[4];
@@ -282,10 +162,6 @@ void   scig_unzoom(integer win_num)
   scig_buzy = 0;
 }
 
-/*******************************************************
- * 3d rotation function 
- ******************************************************/
-
 int scig_3drot(integer win_num)
 {
   integer verb=0,cur,na,ret;
@@ -304,10 +180,6 @@ int scig_3drot(integer win_num)
   return ret;
 }
 
-/********************************************************
- * graphic Window selection 
- ********************************************************/
-
 void scig_sel(integer win_num)
 {
   char c ;
@@ -319,43 +191,6 @@ void scig_sel(integer win_num)
     }
 }
 
-/********************************************************
- * graphic Window raise 
- ********************************************************/
-
-void scig_raise(integer win_num)
-{
-  int cur,n,na,verb=0,iflag=0;
-
-  sciGetIdFigure (PI0,&n,&iflag);
-  if ( n > 0 )
-  {
-    C2F(dr)("xget","window",&verb,&cur,&na,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-     if (win_num != cur) 
-     {
-       C2F(dr)("xset","window",&win_num,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-       sciSwitchWindow(&win_num);
-       C2F(dr)("xselect","v",PI0,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-       C2F(dr)("xset","window",&cur,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-     }
-     else
-     {
-       C2F(dr)("xselect","v",PI0,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-     }
-  }
-  else
-  { 
-    C2F(dr)("xset","window",&win_num,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-    sciSwitchWindow(&win_num);
-  }
-}
-
-
-/********************************************************
- * Reload a saved graphic
- ********************************************************/
-
 void scig_loadsg(int win_num, char *filename)
 {
   integer verb = 0 ;
index d1f896c..9ded47e 100644 (file)
@@ -12,7 +12,6 @@
 #include <string.h>
 #include <stdio.h>
 #include "math_graphics.h"
-#include "Graphics.h" 
 #include "PloEch.h"
 #include "Axes.h"
 #include "DestroyObjects.h"
@@ -22,6 +21,9 @@
 #include "SetProperty.h"
 #include "handleDrawing/drawTextEntity.h"
 #include "sciprint.h"
+#include "Format.h"
+#include "Plo3d.h"
+#include "axesScale.h"
 
 
 #include "MALLOC.h" /* MALLOC */
@@ -3537,4 +3539,2943 @@ int labels2D_draw( sciPointObj * psubwin )
 
   return 0;
 }
-/*-----------------------------------------------------------------------------------------*/
\ No newline at end of file
+/*-----------------------------------------------------------------------------------------*/
+void DrawAxis(double xbox[8], double ybox[8], integer Indices[4], integer style)
+{
+  integer ixbox[6],iybox[6],npoly=6,lstyle[6],verbose=0,narg_,hiddencolor;
+  integer i, iflag=0, j=1;
+  sciPointObj *psubwin;
+  for ( i = 0 ; i <= 4 ; i=i+2)
+  {
+    ixbox[i]=XScale(xbox[Indices[0]]);iybox[i]=YScale(ybox[Indices[0]]);
+  }
+  ixbox[1]=XScale(xbox[Indices[1]]);iybox[1]=YScale(ybox[Indices[1]]);
+  ixbox[3]=XScale(xbox[Indices[2]]);iybox[3]=YScale(ybox[Indices[2]]);
+  ixbox[5]=XScale(xbox[Indices[3]]);iybox[5]=YScale(ybox[Indices[3]]);
+  C2F(dr)("xget","line style",&verbose,lstyle,&narg_,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 
+  /**DJ.Abdemouche 2003**/
+
+  psubwin = sciGetSelectedSubWin (sciGetCurrentFigure ()); 
+  hiddencolor = pSUBWIN_FEATURE (psubwin)->hiddencolor;
+  j = sciGetLineStyle (psubwin) ;
+
+  C2F(dr)("xset","line style",&j,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+  C2F(dr)("xsegs","v",ixbox,iybox,&npoly,&style,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+  C2F(dr)("xset","line style",lstyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+
+}
+/*-----------------------------------------------------------------------------------------*/
+int Axes3dStrings2( integer * ixbox, integer * iybox, integer * xind )
+{
+  integer verbose=0,narg,xz[2],fontid[2],fontsize_kp,color_kp,size;
+  integer iof,barlengthx = 0,barlengthy = 0, posi[2]; 
+  integer rect[4],flag=0,x=0,y=0;
+  double ang=0.0, bbox[6];
+  int fontsize=-1,textcolor=-1,ticscolor=-1;
+  int fontstyle=0; /* F.Leray 08.04.04 */
+  sciPointObj *psubwin = NULL;
+  sciSubWindow * ppsubwin = NULL;
+  int ns=2,iflag=0,gstyle,gridStyle=2,dash[6];
+  double xx[4],yy[4],zz[4],vxx1,vyy1,vzz1;
+  integer i,xm,ym,vx[2],vy[2],xg[2],yg[2],j;
+  integer fontid_old[2], textcolor_old;
+
+  int lastzindex = 0, lastxindex = 0, lastyindex = 0;
+  double xminval, yminval, zminval, xmaxval, ymaxval, zmaxval;
+  int nbtics = 0;
+  int nbsubtics = 0;
+
+  int logrect[4], XX = 0, YY = 0; /* see below */ /* ah ouais ou ca ? */
+  double angle=0.0;
+
+  int constOffset[2] ; /* displacment of labels from the axes segments. */
+  int maxTicksLabelSize[2] ; /* for each axis the maximum size of ticks label */
+
+
+  psubwin= (sciPointObj *)sciGetSelectedSubWin (sciGetCurrentFigure ());
+  ppsubwin = pSUBWIN_FEATURE (psubwin);
+
+  /** le cot\'e gauche ( c'est tjrs un axe des Z **/
+  xz[0] = Cscale.WIRect1[2] ;
+  xz[1] = Cscale.WIRect1[2] ;
+  iof = (xz[0]+xz[1])/50;
+
+  ticscolor = sciGetForeground(psubwin);
+  textcolor=sciGetFontForeground(psubwin);
+
+  fontsize=sciGetFontDeciWidth(psubwin)/100;
+  fontstyle=sciGetFontStyle(psubwin);
+
+  if(sciGetEntityType (psubwin) != SCI_SUBWIN) { 
+    sciprint("Impossible case\n");
+    return 0;
+  }
+
+
+  bbox[0] =  xminval = pSUBWIN_FEATURE (psubwin)->FRect[0]; /*xmin*/
+  bbox[1] =  xmaxval = pSUBWIN_FEATURE (psubwin)->FRect[2]; /*xmax*/
+  bbox[2] =  yminval = pSUBWIN_FEATURE (psubwin)->FRect[1]; /*ymin*/
+  bbox[3] =  ymaxval = pSUBWIN_FEATURE (psubwin)->FRect[3]; /*ymax*/ 
+  bbox[4] =  zminval = pSUBWIN_FEATURE (psubwin)->FRect[4]; /*zmin*/
+  bbox[5] =  zmaxval = pSUBWIN_FEATURE (psubwin)->FRect[5]; /*zmax*/
+
+  C2F(dr)("xget","font",&verbose,fontid,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+
+  fontid[0]= fontstyle;
+  fontsize_kp = fontid[1] ;
+  if( fontsize == -1 ){ 
+    fontid[1]= 1;
+    C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+  }
+  else {
+    fontid[1] = fontsize ;
+    C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+  }
+  if ( textcolor != -1 || ticscolor != -1 ) 
+    C2F(dr)("xget","pattern",&verbose,&color_kp,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);    
+
+  for (i=0; i<3 ; i++) {
+    xx[i]=pSUBWIN_FEATURE (psubwin)->axes.xlim[i];
+    yy[i]=pSUBWIN_FEATURE (psubwin)->axes.ylim[i];
+    zz[i]=pSUBWIN_FEATURE (psubwin)->axes.zlim[i];
+  } 
+
+  /* main title */ /* We fix the title always at the top */
+  rect[0]= Cscale.WIRect1[0] ;
+  rect[1]= Cscale.WIRect1[1] ;
+  rect[2]= Cscale.WIRect1[2] ;
+  rect[3]= Cscale.WIRect1[3]/6 ;
+  textcolor_old = textcolor;
+  fontid_old[0] = fontid[0];
+  fontid_old[1] = fontid[1];
+
+  constOffset[0] = Cscale.WIRect1[2] / 50 + 1 ;
+  constOffset[1] = Cscale.WIRect1[3] / 25 + 1 ;
+
+  if( sciGetVisibility(ppsubwin->mon_title) )
+  {
+    /* get the pointer on the title */
+    sciLabel * ppLabel = pLABEL_FEATURE( ppsubwin->mon_title ) ;
+
+    /* get position and orientation of the title */
+    if ( ppLabel->auto_rotation )
+    {
+      sciSetFontOrientation( ppsubwin->mon_title, 0 ) ;
+    }
+
+    if ( ppLabel->auto_position )
+    {
+      /* same as in 2d */
+      int segmentStart[2] = { rect[0] + rect[2], rect[1] } ;
+      int segmentEnd[2]   = { rect[0]          , rect[1] } ;
+      computeLabelAutoPos( ppsubwin->mon_title, segmentStart, segmentEnd, constOffset ) ;
+    }
+    /* draw the label */
+    drawTextEntity( ppLabel->text ) ;
+  }
+
+  textcolor = textcolor_old;
+  fontid[0] = fontid_old[0];
+  fontid[1] = fontid_old[1];
+
+  size = xz[0]>=xz[1] ? (integer) (xz[1]/50.0) : (integer) (xz[0]/50.0); 
+
+  /* compute bounding of "10"  string used for log scale ON and auto_ticks ON */
+  C2F(dr)("xstringl","10",&XX,&YY,logrect,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
+
+  /********************************************/
+  /* draw the axis line if axes_visible is on */
+  /********************************************/
+  {
+    int x2[5] ;
+    int two = 2 ;
+    int one = 1 ;
+    int verbose2 = 0 ;
+    int dash2[6] ;
+    int pat ;
+    int narg2 ;
+    x2[0] = sciGetForeground (psubwin);
+    x2[2] = sciGetLineWidth (psubwin) ;
+    x2[3] = sciGetLineStyle (psubwin);
+    x2[4] = 0;
+    C2F(dr)("xget","line style",&verbose2,dash2,&narg2,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 
+    C2F(dr)("xget","pattern",&verbose2,&pat,&narg2,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+    C2F (dr) ("xset", "dashes", x2, x2, x2+4, x2+4, x2+4,PI0,PD0,PD0,PD0,PD0, 5L, 6L);
+    C2F (dr) ("xset","foreground",x2,x2,x2+4,x2+4,x2+4,PI0,PD0,PD0,PD0,PD0,5L,4096); /* F.Leray 05.03.04 Useless too*/
+    C2F (dr) ("xset","thickness",x2+2,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+    C2F (dr) ("xset", "line style", x2+3,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+    if ( ppsubwin->axes.axes_visible[2] )
+    {
+      /* draw the line of the axis like in 2d */
+      /* the two bounds are (ixbox[2],iybox[2]) and (ixbox[2],iybox[2]) */
+      C2F(dr)("xpolys","v",&(ixbox[2]),&(iybox[2]),x2,&one,&two, PI0,PD0,PD0,PD0,PD0,0L,0L);
+    }
+    if ( ( xind[4]+xind[5] == 3) || ( xind[4]+xind[5] == 11 ) )
+    {
+      /* i copy this test but I don't know what it mean... jb Silvy 03/2006 */
+      if ( ppsubwin->axes.axes_visible[1] )
+      {
+        /* draw the line of the axis like in 2d */
+        /* the two bounds are (ixbox[3],iybox[3]) and (ixbox[3],iybox[3]) */
+        C2F(dr)("xpolys","v",&(ixbox[3]),&(iybox[3]),x2,&one,&two, PI0,PD0,PD0,PD0,PD0,0L,0L);
+      }
+      if ( ppsubwin->axes.axes_visible[0] )
+      {
+        /* draw the line of the axis like in 2d */
+        /* the two bounds are (ixbox[4],iybox[4]) and (ixbox[4],iybox[4]) */
+        C2F(dr)("xpolys","v",&(ixbox[4]),&(iybox[4]),x2,&one,&two, PI0,PD0,PD0,PD0,PD0,0L,0L);
+      }
+    }
+    else
+    {
+      if ( ppsubwin->axes.axes_visible[1] )
+      {
+        /* draw the line of the axis like in 2d */
+        /* the two bounds are (ixbox[3],iybox[3]) and (ixbox[3],iybox[3]) */
+        C2F(dr)("xpolys","v",&(ixbox[4]),&(iybox[4]),x2,&one,&two, PI0,PD0,PD0,PD0,PD0,0L,0L);
+      }
+      if ( ppsubwin->axes.axes_visible[0] )
+      {
+        /* draw the line of the axis like in 2d */
+        /* the two bounds are (ixbox[4],iybox[4]) and (ixbox[4],iybox[4]) */
+        C2F(dr)("xpolys","v",&(ixbox[3]),&(iybox[3]),x2,&one,&two, PI0,PD0,PD0,PD0,PD0,0L,0L);
+      }
+    }
+    C2F(dr)("xset","pattern",&pat,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+    C2F(dr)("xset","line style",dash2,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+  }  
+
+  /********************/
+  /*** le z scaling ***/ /* DISPLAY Z graduations */
+  /********************/
+
+
+  if (pSUBWIN_FEATURE (psubwin)->project[2]==1)
+  {
+    double fx,fy,fz; 
+    char c_format[5] ;
+
+    integer Ticsdir[2];
+    Ticsdir[0]=ixbox[3]-ixbox[4]; /* <=> en pixel direction/vecteur non norme(e)s des tics en x */
+    Ticsdir[1]=iybox[3]-iybox[4]; /* <=> idem pour y */
+    /* NB: for a default plot3d (simply calling plot3d in siclab console) */
+    /* Ticsdir[0] & Ticsdir[1] are negative : we do min - max here... */
+
+    BBoxToval(&fx,&fy,&fz,xind[3],bbox); /* xind[3] <=> en bas a gauche <=> zmin */
+    x=ixbox[2]-(xz[0]+xz[1])/20;
+    y=(iybox[3]+iybox[2])/2;
+
+    /*       NumberFormat(str,((integer) zz[0]),((integer) zz[2])); */
+
+
+    if( !ppsubwin->axes.auto_ticks[2] )
+    {
+      /* we display the z tics specified by the user*/
+      nbtics = ppsubwin->axes.u_nzgrads;
+      nbsubtics = ppsubwin->axes.nbsubtics[2];
+
+      maxTicksLabelSize[0] = 0 ;
+      maxTicksLabelSize[1] = 0 ;
+
+      for(i=0;i<nbtics;i++)
+      {
+        char *foo = ppsubwin->axes.u_zlabels[i]; 
+        double ztmp = ppsubwin->axes.u_zgrads[i];
+
+        if(ztmp<zminval || ztmp>zmaxval) 
+        {
+          /*   sciprint("je rejete la valeur: %lf\n\n",xtmp); */
+          continue; /* cas ou TL est ON et on a des graduations qui ne seront pas affichees de tte facon */
+          /* donc autant ne pas aller plus loin dans l'algo... */
+        }
+
+
+        /***************************************************************/
+        /************************* COMMON PART *************************/
+        /***************************************************************/
+
+        if( ppsubwin->axes.reverse[2] )
+        {
+          ztmp = InvAxis(ppsubwin->FRect[4],ppsubwin->FRect[5],ztmp);
+        }
+
+        ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&fy,&ztmp);
+
+
+        vx[0]=xm;vy[0]=ym;
+
+        barlengthx= (integer) (( Ticsdir[0])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
+        barlengthy= (integer) (( Ticsdir[1])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
+        vx[1]=vx[0]+barlengthx;
+        vy[1]=vy[0]+barlengthy;
+
+        /* foo is set above with sprintf(foo,c_format,xtmp); */
+
+        C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); /* fix bug noticed by R.N. */
+
+        /* get the size of ticks label */
+        C2F(dr)("xstringl",foo,&x,&y,rect,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+        maxTicksLabelSize[0] = Max( maxTicksLabelSize[0], rect[2] ) ;
+        maxTicksLabelSize[1] = Max( maxTicksLabelSize[1], rect[3] ) ;
+
+
+        posi[0] = inint( xm+2*barlengthx - rect[2]); 
+        posi[1]=inint( ym + 2*barlengthy + rect[3]/2);
+
+
+        if(ppsubwin->axes.axes_visible[2] == TRUE){
+          C2F(dr)("xset","pattern",&textcolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+          C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+          C2F(dr)("xstring",foo,&(posi[0]),&(posi[1]),PI0,&flag,PI0,PI0,&ang, PD0,PD0,PD0,0L,0L);
+          C2F(dr)("xset","pattern",&ticscolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+          C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+        }
+        /* grid to put here */
+        if ( ppsubwin->grid[2] > -1 && ppsubwin->axes.axes_visible[2] )
+        {
+          gstyle = pSUBWIN_FEATURE (psubwin)->grid[2];
+
+          if((ppsubwin->logflags[2] =='l') && (i != nbtics-1))
+          {
+            double tmp[2];
+            double pas=0;
+            double * tmp_log_grads = (double *) NULL;
+
+
+            double * grads = ppsubwin->axes.u_zgrads;
+
+            tmp[0] = exp10(grads[i]);
+            tmp[1] = exp10(grads[i+1]);
+            pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
+
+            if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
+              sciprint("Error allocating tmp_log_grads\n");
+              return -1;
+            }
+
+            for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
+
+            for(j=0;j<nbsubtics;j++)
+            {
+              vzz1 = tmp_log_grads[j];
+
+              if(vzz1<=zminval || vzz1>=zmaxval) continue;      
+
+              if(ppsubwin->axes.reverse[2] == TRUE)
+                vzz1 = InvAxis(ppsubwin->FRect[4],ppsubwin->FRect[5],vzz1);
+
+              ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&fy,&vzz1);
+
+              /*  if ((ym != iybox[3]) && (ym != iybox[2])) */
+              /*                           { */
+              C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              xg[0]= ixbox[3];yg[0]= ym;
+              if (Ishidden(psubwin))
+              {  xg[1]=ixbox[4];  yg[1]= iybox[4]- iybox[3]+ym;}
+              else
+              {xg[1]=ixbox[1];  yg[1]= iybox[1]- iybox[2]+ym;}
+              C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              xg[0]=xg[1];  ; xg[1] =ixbox[0];
+              yg[0]=yg[1]; yg[1]= ym- iybox[3]+ iybox[5];
+              C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              /*   } */
+            }
+            FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
+          }
+          else
+          { 
+            if(ztmp>zminval && ztmp<zmaxval) 
+            {
+              C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              xg[0]= ixbox[3];yg[0]= ym;
+              if (Ishidden(psubwin))
+              {  xg[1]=ixbox[4];  yg[1]= iybox[4]- iybox[3]+ym;}
+              else
+              {xg[1]=ixbox[1];  yg[1]= iybox[1]- iybox[2]+ym;}
+              C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              xg[0]=xg[1];  ; xg[1] =ixbox[0];
+              yg[0]=yg[1]; yg[1]= ym- iybox[3]+ iybox[5];
+              C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            }
+          }
+        }
+
+        /* and subtics */
+        if(i != nbtics-1)
+        {
+          if(ppsubwin->logflags[2] =='l')
+          {
+            double tmp[2];
+            double pas=0;
+            double * tmp_log_grads = (double *) NULL;
+
+
+            double * grads = ppsubwin->axes.u_zgrads;
+
+            tmp[0] = exp10(grads[i]);
+            tmp[1] = exp10(grads[i+1]);
+            pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
+
+            if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
+              sciprint("Error allocating tmp_log_grads\n");
+              return -1;
+            }
+
+            for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
+
+            for(j=0;j<nbsubtics;j++)
+            {
+              vzz1 = tmp_log_grads[j];
+
+              if(vzz1<zminval || vzz1>zmaxval) continue;
+
+              if(ppsubwin->axes.reverse[2] == TRUE)
+                vzz1 = InvAxis(ppsubwin->FRect[4],ppsubwin->FRect[5],vzz1);
+
+              ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&fy,&vzz1);
+
+              vx[0]=xm;vy[0]=ym;
+              vx[1]= (integer) (vx[0]+barlengthx/2.0);
+              vy[1]= (integer) (vy[0]+barlengthy/2.0);
+
+              if(ppsubwin->axes.axes_visible[2] == TRUE)
+                C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            }
+            FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
+          } /* end NEW */
+          else
+          {
+            double xtmp = ppsubwin->axes.u_zgrads[i];
+            double dx = (ppsubwin->axes.u_zgrads[i+1] - ppsubwin->axes.u_zgrads[i]) / nbsubtics;
+            for(j=0;j<nbsubtics;j++)
+            {
+              vzz1=xtmp+dx*j;
+
+              if(vzz1<zminval || vzz1>zmaxval) continue;        
+
+              if(ppsubwin->axes.reverse[2] == TRUE)
+                vzz1 = InvAxis(ppsubwin->FRect[4],ppsubwin->FRect[5],vzz1);
+
+              ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&fy,&vzz1);
+              /*                     trans3d(psubwin,1,&xm,&ym,&fx,&fy,&vzz1); */
+
+
+              vx[0]=xm;vy[0]=ym;
+              vx[1]= (integer) (vx[0]+barlengthx/2.0);
+              vy[1]= (integer) (vy[0]+barlengthy/2.0);
+
+              if(ppsubwin->axes.axes_visible[2] == TRUE)
+                C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            }
+          } 
+        }
+
+        /***************************************************************/
+        /************************* END OF COMMON PART ******************/
+        /***************************************************************/
+      }
+    }
+    else /* we display the computed tics */
+    {
+      AdaptGraduationsOnZ(x,y,size,Ticsdir,fontid,psubwin,zminval,zmaxval,fx,fy,0.);
+
+      lastzindex = ppsubwin->axes.nzgrads - 1;
+
+      if(lastzindex == 0)
+        ChooseFormatForOneGrad(c_format,&(ppsubwin->axes.zgrads[0]));
+      else
+        ChoixFormatE(c_format,
+        ppsubwin->axes.zgrads[0],
+        ppsubwin->axes.zgrads[lastzindex],
+        ((ppsubwin->axes.zgrads[lastzindex])-(ppsubwin->axes.zgrads[0]))/(lastzindex));
+
+      nbtics = ppsubwin->axes.nzgrads;
+      nbsubtics = ppsubwin->axes.nbsubtics[2];
+
+      maxTicksLabelSize[0] = 0 ;
+      maxTicksLabelSize[1] = 0 ;
+
+      for(i=0;i<nbtics;i++)
+      {
+        char foo[256]; 
+        double ztmp = ppsubwin->axes.zgrads[i];
+
+        if(ztmp<zminval || ztmp>zmaxval) 
+        {
+          /*   sciprint("je rejete la valeur: %lf\n\n",xtmp); */
+          continue; /* cas ou TL est ON et on a des graduations qui ne seront pas affichees de tte facon */
+          /* donc autant ne pas aller plus loin dans l'algo... */
+        }
+
+        sprintf(foo,c_format,ztmp);
+
+        /***************************************************************/
+        /************************* COMMON PART *************************/
+        /***************************************************************/
+        if(ppsubwin->axes.reverse[2] == TRUE)
+          ztmp = InvAxis(ppsubwin->FRect[4],ppsubwin->FRect[5],ztmp);
+
+        ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&fy,&ztmp);
+
+        /*           trans3d(psubwin,1,&xm,&ym,&fx,&fy,&ztmp); */
+
+
+        vx[0]=xm;vy[0]=ym;
+
+        barlengthx= (integer) (( Ticsdir[0])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
+        barlengthy= (integer) (( Ticsdir[1])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
+        vx[1]=vx[0]+barlengthx;
+        vy[1]=vy[0]+barlengthy;
+
+        /* foo is set above with sprintf(foo,c_format,xtmp); */
+
+        C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); /* fix bug noticed by R.N. */
+
+        /* get the size of ticks label */
+        C2F(dr)("xstringl",foo,&x,&y,rect,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+        maxTicksLabelSize[0] = Max( maxTicksLabelSize[0], rect[2] ) ;
+        maxTicksLabelSize[1] = Max( maxTicksLabelSize[1], rect[3] ) ;
+
+        posi[0] = inint( xm+2*barlengthx - rect[2]); 
+        posi[1]=inint( ym + 2*barlengthy + rect[3]/2);
+
+        if(ppsubwin->axes.axes_visible[2] == TRUE){
+          C2F(dr)("xset","pattern",&textcolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+          C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+          if ( ppsubwin->logflags[2] == 'l' )
+          {
+            int smallersize = fontid[1]-2;
+            int old_rect10[4];
+            /*                     char str[2] = "xv"; */
+            int posi10[2];
+
+            posi10[0] = posi[0] - logrect[2];
+            posi10[1] = posi[1] + logrect[3];
+
+            C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            C2F(dr)("xstring","10",(&posi10[0]),(&posi10[1]),PI0,&flag,PI0,PI0,&angle,PD0,PD0,PD0,0L,0L);
+
+            C2F(dr)("xstringl","10",(&posi10[0]),(&posi10[1]),old_rect10,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+
+            posi[0] = old_rect10[0] + old_rect10[2];
+            posi[1] = (int) (old_rect10[1] - old_rect10[3]*.1);
+
+            C2F(dr)("xset","font",fontid,&smallersize,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            C2F(dr)("xstring",foo,&(posi[0]),&(posi[1]),PI0,&flag,PI0,PI0,&ang, PD0,PD0,PD0,0L,0L);
+
+            /* put back the current fontid */
+            C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+          }
+          else{
+            C2F(dr)("xstring",foo,&(posi[0]),&(posi[1]),PI0,&flag,PI0,PI0,&ang, PD0,PD0,PD0,0L,0L);
+          }
+
+          C2F(dr)("xset","pattern",&ticscolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);   
+          C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+        }
+        /* grid to put here */
+        if ( ppsubwin->grid[2] > -1 && ppsubwin->axes.axes_visible[2] )
+        {
+          gstyle = pSUBWIN_FEATURE (psubwin)->grid[2];
+
+          if((ppsubwin->logflags[2] =='l') && (i != nbtics-1))
+          {
+            double tmp[2];
+            double pas=0;
+            double * tmp_log_grads = (double *) NULL;
+
+
+            double * grads = ppsubwin->axes.zgrads;
+
+            tmp[0] = exp10(grads[i]);
+            tmp[1] = exp10(grads[i+1]);
+            pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
+
+            if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
+              sciprint("Error allocating tmp_log_grads\n");
+              return -1;
+            }
+
+            for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
+
+            for(j=0;j<nbsubtics;j++)
+            {
+              vzz1 = tmp_log_grads[j];
+
+              if(vzz1<=zminval || vzz1>=zmaxval) continue;      
+
+              if(ppsubwin->axes.reverse[2] == TRUE)
+                vzz1 = InvAxis(ppsubwin->FRect[4],ppsubwin->FRect[5],vzz1);
+
+              ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&fy,&vzz1);
+
+              /*  if ((ym != iybox[3]) && (ym != iybox[2])) */
+              /*                           { */
+              C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              xg[0]= ixbox[3];yg[0]= ym;
+              if (Ishidden(psubwin))
+              {  xg[1]=ixbox[4];  yg[1]= iybox[4]- iybox[3]+ym;}
+              else
+              {xg[1]=ixbox[1];  yg[1]= iybox[1]- iybox[2]+ym;}
+              C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              xg[0]=xg[1];  ; xg[1] =ixbox[0];
+              yg[0]=yg[1]; yg[1]= ym- iybox[3]+ iybox[5];
+              C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              /*   } */
+            }
+            FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
+          }
+          else
+          {
+            if(ztmp>zminval && ztmp<zmaxval) 
+            {
+              C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              xg[0]= ixbox[3];yg[0]= ym;
+              if (Ishidden(psubwin))
+              {  xg[1]=ixbox[4];  yg[1]= iybox[4]- iybox[3]+ym;}
+              else
+              {xg[1]=ixbox[1];  yg[1]= iybox[1]- iybox[2]+ym;}
+              C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              xg[0]=xg[1];  ; xg[1] =ixbox[0];
+              yg[0]=yg[1]; yg[1]= ym- iybox[3]+ iybox[5];
+              C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            }
+          }
+        }
+
+        /* and subtics */
+        if(i != nbtics-1)
+        {
+          if(ppsubwin->logflags[2] =='l')
+          {
+            double tmp[2];
+            double pas=0;
+            double * tmp_log_grads = (double *) NULL;
+
+
+            double * grads = ppsubwin->axes.zgrads;
+
+            tmp[0] = exp10(grads[i]);
+            tmp[1] = exp10(grads[i+1]);
+            pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
+
+            if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
+              sciprint("Error allocating tmp_log_grads\n");
+              return -1;
+            }
+
+            for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
+
+            for(j=0;j<nbsubtics;j++)
+            {
+              vzz1 = tmp_log_grads[j];
+
+              if(vzz1<zminval || vzz1>zmaxval) continue;
+
+              if(ppsubwin->axes.reverse[2] == TRUE)
+                vzz1 = InvAxis(ppsubwin->FRect[4],ppsubwin->FRect[5],vzz1);
+
+              ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&fy,&vzz1);
+
+              vx[0]=xm;vy[0]=ym;
+              vx[1]= (integer) (vx[0]+barlengthx/2.0);
+              vy[1]= (integer) (vy[0]+barlengthy/2.0);
+
+              if(ppsubwin->axes.axes_visible[2] == TRUE)
+                C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            }
+            FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
+          } /* end NEW */
+          else
+          {
+            double ztmp2 = ppsubwin->axes.zgrads[i];
+            double dz = (ppsubwin->axes.zgrads[i+1] - ppsubwin->axes.zgrads[i]) / nbsubtics;
+            for(j=0;j<nbsubtics;j++)
+            {
+              vzz1=ztmp2+dz*j;
+
+              if(vzz1<zminval || vzz1>zmaxval) continue;
+
+              if(ppsubwin->axes.reverse[2] == TRUE)
+                vzz1 = InvAxis(ppsubwin->FRect[4],ppsubwin->FRect[5],vzz1);
+
+              ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&fy,&vzz1);
+              /*                     trans3d(psubwin,1,&xm,&ym,&fx,&fy,&vzz1); */
+
+
+              vx[0]=xm;vy[0]=ym;
+              vx[1]= (integer) (vx[0]+barlengthx/2.0);
+              vy[1]= (integer) (vy[0]+barlengthy/2.0);
+
+              if(ppsubwin->axes.axes_visible[2] == TRUE)
+                C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            }
+          }
+        }
+        /***************************************************************/
+        /************************* END OF COMMON PART ******************/
+        /***************************************************************/
+
+      }
+    }
+  }
+
+  if ( sciGetVisibility(ppsubwin->mon_z_label) )
+  {
+    /* draw z label */
+    sciLabel * ppLabel = pLABEL_FEATURE(ppsubwin->mon_z_label) ;
+
+    if ( ppLabel->auto_rotation )
+    {
+      /* mult by 10 because */
+      sciSetFontOrientation(ppsubwin->mon_z_label, 270 * 10 ) ;
+    }
+
+    if( ppLabel->auto_position )
+    {
+
+      int segmentStart[2] = { ixbox[2], iybox[2] } ;
+      int segmentEnd[2]   = { ixbox[3], iybox[3] } ;
+
+      /* add the bar size and ticks label size to the offset */
+      int offset[2] = { constOffset[0] + maxTicksLabelSize[0] + abs( barlengthx ), 
+        constOffset[1] + maxTicksLabelSize[1] + abs( barlengthy )  } ;
+      computeLabelAutoPos( ppsubwin->mon_z_label, segmentStart, segmentEnd, offset ) ;
+    }
+    /* a trick to force the display with 2d scale */
+    drawTextEntity( ppLabel->text ) ;
+
+  }
+
+
+  /***********************/ /** bottom right side ***/
+  /*** le  x-y scaling ***/ /* DISPLAY x or y graduations */
+  /***********************/
+
+
+  if (( xind[4]+xind[5] == 3) || ( xind[4]+xind[5] == 11))
+  {
+    if (pSUBWIN_FEATURE (psubwin)->project[0]==1) /* x HERE */
+    {
+      double fx,fy,fz;
+      char c_format[5];
+
+      integer Ticsdir[2]; 
+      Ticsdir[0]=ixbox[4]-ixbox[3];
+      Ticsdir[1]=iybox[4]-iybox[3];
+      BBoxToval(&fx,&fy,&fz,xind[4],bbox);
+      x=inint((ixbox[4]+ixbox[5])/2+1.5*rect[2] +iof);
+      y=inint(((2/3.0)*iybox[4]+(1/3.0)*iybox[5])+1.5*rect[3]+iof);
+
+      if( !ppsubwin->axes.auto_ticks[0] )
+      {
+        /* we display the x tics specified by the user*/
+        nbtics = ppsubwin->axes.u_nxgrads;
+        nbsubtics = ppsubwin->axes.nbsubtics[0];
+
+        maxTicksLabelSize[0] = 0 ;
+        maxTicksLabelSize[1] = 0 ;
+
+        for(i=0;i<nbtics;i++)
+        {
+          char *foo = ppsubwin->axes.u_xlabels[i]; 
+          double xtmp = ppsubwin->axes.u_xgrads[i];
+
+          if(xtmp<xminval || xtmp>xmaxval) 
+          {
+            /*   sciprint("je rejete la valeur: %lf\n\n",xtmp); */
+            continue; /* cas ou TL est ON et on a des graduations qui ne seront pas affichees de tte facon */
+            /* donc autant ne pas aller plus loin dans l'algo... */
+          }
+
+          /***************************************************************/
+          /************************* COMMON PART *************************/
+          /***************************************************************/
+
+          if(ppsubwin->axes.reverse[0] == TRUE)
+            xtmp = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],xtmp);
+
+          ComputeGoodTrans3d(psubwin,1,&xm,&ym,&xtmp,&fy,&fz);
+          /*   trans3d(psubwin,1,&xm,&ym,&xtmp,&fy,&fz); */
+
+
+          vx[0]=xm;vy[0]=ym;
+
+          barlengthx= (integer) (( Ticsdir[0])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
+          barlengthy= (integer) (( Ticsdir[1])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
+
+          C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); /* fix bug noticed by R.N. */
+
+          /* get the size of the icks label */
+          C2F(dr)("xstringl",foo,&x,&y,rect,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+          maxTicksLabelSize[0] = Max( maxTicksLabelSize[0], rect[2] ) ;
+          maxTicksLabelSize[1] = Max( maxTicksLabelSize[1], rect[3] ) ;
+
+
+          if (IsDownAxes(psubwin)){
+            vx[1]=vx[0];
+            vy[1]=vy[0]+iof/2;
+            posi[0] = inint(xm-rect[2]/2); 
+            posi[1]=inint( vy[0] + iof + rect[3]);}
+          else{
+            vx[1]=vx[0]+barlengthx;
+            vy[1]=vy[0]+barlengthy;
+            posi[0] = inint( xm+2*barlengthx);
+            posi[1]=inint( ym + 2*barlengthy + rect[3]);}
+
+          if( ppsubwin->axes.axes_visible[0] )
+          {    
+            C2F(dr)("xset","pattern",&textcolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            C2F(dr)("xstring",foo,&(posi[0]),&(posi[1]),PI0,&flag,PI0,PI0,&ang, PD0,PD0,PD0,0L,0L);
+            C2F(dr)("xset","pattern",&ticscolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);   
+            C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+          }
+          /* grid to put here */
+          if ( ppsubwin->grid[0] > -1 && ppsubwin->axes.axes_visible[0] )
+          {
+            gstyle = pSUBWIN_FEATURE (psubwin)->grid[0];
+
+            if((ppsubwin->logflags[0] =='l') && (i != nbtics-1))
+            {
+              double tmp[2];
+              double pas=0;
+              double * tmp_log_grads = (double *) NULL;
+
+
+              double * grads = ppsubwin->axes.u_xgrads;
+
+              tmp[0] = exp10(grads[i]);
+              tmp[1] = exp10(grads[i+1]);
+              pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
+
+              if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
+                sciprint("Error allocating tmp_log_grads\n");
+                return -1;
+              }
+
+              for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
+
+              for(j=0;j<nbsubtics;j++)
+              {
+                vxx1 = tmp_log_grads[j];
+
+                if(vxx1<=xminval || vxx1>=xmaxval) continue;
+
+                if(ppsubwin->axes.reverse[0] == TRUE)
+                  vxx1 = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],vxx1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&vxx1,&fy,&fz);
+
+                /*  if ((xm != ixbox[5]) && (xm != ixbox[4])) */
+                /*                             {  */
+                xg[0]= xm;  yg[0]= ym;  
+                if (Ishidden(psubwin)) 
+                { xg[1]= xm; yg[1]= iybox[2] -iybox[3]+ym; }
+                else
+                {xg[1]= ixbox[3] - ixbox[4] +xm; yg[1]= iybox[3] - iybox[4] +ym; } 
+
+                C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                xg[0]= xg[1]; yg[0]= yg[1];
+                xg[1] = ixbox[3] - ixbox[4] +xm; 
+                yg[1]=  iybox[2] - iybox[4] +ym;
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
+                /*     } */
+              }
+              FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
+            }
+            else
+            {
+              if(xtmp>xminval && xtmp<xmaxval) 
+              {
+                xg[0]= xm;  yg[0]= ym;  
+                if (Ishidden(psubwin)) 
+                { xg[1]= xm; yg[1]= iybox[2] -iybox[3]+ym; }
+                else
+                {xg[1]= ixbox[3] - ixbox[4] +xm; yg[1]= iybox[3] - iybox[4] +ym; } 
+                C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                xg[0]= xg[1]; yg[0]= yg[1];
+                xg[1] = ixbox[3] - ixbox[4] +xm; 
+                yg[1]=  iybox[2] - iybox[4] +ym;
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
+              }
+            }
+          }
+
+          /* and subtics */
+          if(i != nbtics-1)
+          {
+            if(ppsubwin->logflags[0] =='l')
+            {
+              double tmp[2];
+              double pas=0;
+              double * tmp_log_grads = (double *) NULL;
+
+
+              double * grads = ppsubwin->axes.u_xgrads;
+
+              tmp[0] = exp10(grads[i]);
+              tmp[1] = exp10(grads[i+1]);
+              pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
+
+              if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
+                sciprint("Error allocating tmp_log_grads\n");
+                return -1;
+              }
+
+              for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
+
+              for(j=0;j<nbsubtics;j++)
+              {
+                vxx1 = tmp_log_grads[j];
+
+                if(vxx1<xminval || vxx1>xmaxval) continue;
+
+                if(ppsubwin->axes.reverse[0] == TRUE)
+                  vxx1 = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],vxx1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&vxx1,&fy,&fz);
+
+                if (IsDownAxes(psubwin))
+                {
+                  vx[1]=vx[0]=xm;
+                  vy[0]=ym;
+                  vy[1]=vy[0]+iof/4;
+                }
+                else
+                {
+                  vx[0]=xm;vy[0]=ym;
+                  vx[1]= (integer) (vx[0]+barlengthx/2.0);
+                  vy[1]= (integer) (vy[0]+barlengthy/2.0);
+                }
+
+                if(ppsubwin->axes.axes_visible[0] == TRUE)
+                  C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              }
+
+              FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
+            } /* end NEW */
+            else
+            {
+              double xtmp2 = ppsubwin->axes.u_xgrads[i];
+              double dx = (ppsubwin->axes.u_xgrads[i+1] - ppsubwin->axes.u_xgrads[i]) / nbsubtics;
+
+              for (j=1;j<nbsubtics;j++)
+              {  
+                vxx1=xtmp2+dx*j;
+
+                if(vxx1<xminval || vxx1>xmaxval) continue;
+
+                if(ppsubwin->axes.reverse[0] == TRUE)
+                  vxx1 = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],vxx1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&vxx1,&fy,&fz);
+                /*                       trans3d(psubwin,1,&xm,&ym,&vxx1,&fy,&fz); */
+
+
+                if (IsDownAxes(psubwin))
+                {
+                  vx[1]=vx[0]=xm;
+                  vy[0]=ym;
+                  vy[1]=vy[0]+iof/4;
+                }
+                else
+                {
+                  vx[0]=xm;vy[0]=ym;
+                  vx[1]= (integer) (vx[0]+barlengthx/2.0);
+                  vy[1]= (integer) (vy[0]+barlengthy/2.0);
+                }
+
+                if(ppsubwin->axes.axes_visible[0] == TRUE)   
+                  C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              }
+            }
+          }
+          /***************************************************************/
+          /************************* END OF COMMON PART ******************/
+          /***************************************************************/
+
+        }
+      }
+      else /* we display the computed tics */
+      {
+        AdaptGraduationsOnXBottomRight(iof,x,y,size,Ticsdir,fontid,psubwin,xminval,xmaxval,0.,fy,fz);
+
+        lastxindex = ppsubwin->axes.nxgrads - 1;
+
+        if(lastxindex == 0)
+        {
+          ChooseFormatForOneGrad(c_format,&(ppsubwin->axes.xgrads[0]));
+        }
+        else
+        {
+          ChoixFormatE(c_format,
+            ppsubwin->axes.xgrads[0],
+            ppsubwin->axes.xgrads[lastxindex],
+            ((ppsubwin->axes.xgrads[lastxindex])-(ppsubwin->axes.xgrads[0]))/(lastxindex));
+        }
+
+        nbtics = ppsubwin->axes.nxgrads;
+        nbsubtics = ppsubwin->axes.nbsubtics[0];
+
+        maxTicksLabelSize[0] = 0 ;
+        maxTicksLabelSize[1] = 0 ;
+
+        for(i=0;i<nbtics;i++)
+        {
+          char foo[256]; 
+          double xtmp = ppsubwin->axes.xgrads[i];
+
+          if(xtmp<xminval || xtmp>xmaxval) 
+          {
+            /*   sciprint("je rejete la valeur: %lf\n\n",xtmp); */
+            continue; /* cas ou TL est ON et on a des graduations qui ne seront pas affichees de tte facon */
+            /* donc autant ne pas aller plus loin dans l'algo... */
+          }
+
+          sprintf(foo,c_format,xtmp);
+
+          /***************************************************************/
+          /************************* COMMON PART *************************/
+          /***************************************************************/
+
+
+          /* F.Leray 03.11.04 Test if log scale to perform a : exp10(x) because trans3d will */
+          /* re-do a log10() (that is needed for data computations) */
+
+          if( ppsubwin->axes.reverse[0] )
+          {
+            xtmp = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],xtmp);
+          }
+
+          ComputeGoodTrans3d(psubwin,1,&xm,&ym,&xtmp,&fy,&fz);
+
+          vx[0]=xm;vy[0]=ym; 
+
+          barlengthx= (integer) (( Ticsdir[0])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
+          barlengthy= (integer) (( Ticsdir[1])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
+
+          C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); /* fix bug noticed by R.N. */
+
+          /* get the size of ticks label */
+          C2F(dr)("xstringl",foo,&x,&y,rect,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+          maxTicksLabelSize[0] = Max( maxTicksLabelSize[0], rect[2] ) ;
+          maxTicksLabelSize[1] = Max( maxTicksLabelSize[1], rect[3] ) ;
+
+          if (IsDownAxes(psubwin)){
+            vx[1]=vx[0];
+            vy[1]=vy[0]+iof/2;
+            posi[0] = inint(xm-rect[2]/2); 
+            posi[1]=inint( vy[0] + iof + rect[3]);}
+          else{
+            vx[1]=vx[0]+barlengthx;
+            vy[1]=vy[0]+barlengthy;
+            posi[0] = inint( xm+2*barlengthx);
+            posi[1]=inint( ym + 2*barlengthy + rect[3]);}
+
+          if( ppsubwin->axes.axes_visible[0] )
+          {
+            C2F(dr)("xset","pattern",&textcolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            if ( ppsubwin->logflags[0] == 'l' )
+            {
+              int smallersize = fontid[1]-2;
+              int old_rect10[4];
+              int posi10[2];
+
+              posi10[0] = posi[0] - logrect[2];
+              posi10[1] = posi[1] + logrect[3];
+
+              C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              C2F(dr)("xstring","10",(&posi10[0]),(&posi10[1]),PI0,&flag,PI0,PI0,&angle,PD0,PD0,PD0,0L,0L);
+
+              C2F(dr)("xstringl","10",(&posi10[0]),(&posi10[1]),old_rect10,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+
+              posi[0] = old_rect10[0] + old_rect10[2];
+              posi[1] = (int) (old_rect10[1] - old_rect10[3]*.1);
+
+              C2F(dr)("xset","font",fontid,&smallersize,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              C2F(dr)("xstring",foo,&(posi[0]),&(posi[1]),PI0,&flag,PI0,PI0,&ang, PD0,PD0,PD0,0L,0L);
+
+              /* put back the current fontid */
+              C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            }
+            else
+            {
+              C2F(dr)("xstring",foo,&(posi[0]),&(posi[1]),PI0,&flag,PI0,PI0,&ang, PD0,PD0,PD0,0L,0L);
+            }      
+            C2F(dr)("xset","pattern",&ticscolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);   
+            C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+          }
+          /* grid to put here */
+          if ( ppsubwin->grid[0] > -1 && ppsubwin->axes.axes_visible[0]  )
+          {
+            gstyle = pSUBWIN_FEATURE (psubwin)->grid[0];
+
+            if((ppsubwin->logflags[0] =='l') && (i != nbtics-1))
+            {
+              double tmp[2];
+              double pas=0;
+              double * tmp_log_grads = (double *) NULL;
+
+
+              double * grads = ppsubwin->axes.xgrads;
+
+              tmp[0] = exp10(grads[i]);
+              tmp[1] = exp10(grads[i+1]);
+              pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
+
+              if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
+                sciprint("Error allocating tmp_log_grads\n");
+                return -1;
+              }
+
+              for(j=0;j<nbsubtics;j++)
+              {
+                tmp_log_grads[j] = log10( tmp[0] + (j) * pas ) ;
+              }
+
+              for(j=0;j<nbsubtics;j++)
+              {
+                vxx1 = tmp_log_grads[j];
+
+                if(vxx1<=xminval || vxx1>=xmaxval) continue;
+
+                if(ppsubwin->axes.reverse[0] == TRUE)
+                  vxx1 = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],vxx1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&vxx1,&fy,&fz);
+
+                /*  if ((xm != ixbox[5]) && (xm != ixbox[4])) */
+                /*                             {  */
+                xg[0]= xm;  yg[0]= ym;  
+                if (Ishidden(psubwin)) 
+                { xg[1]= xm; yg[1]= iybox[2] -iybox[3]+ym; }
+                else
+                {xg[1]= ixbox[3] - ixbox[4] +xm; yg[1]= iybox[3] - iybox[4] +ym; } 
+
+                C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                xg[0]= xg[1]; yg[0]= yg[1];
+                xg[1] = ixbox[3] - ixbox[4] +xm; 
+                yg[1]=  iybox[2] - iybox[4] +ym;
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
+                /*     } */
+              }
+              FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
+            }
+            else
+            {
+              if(xtmp>xminval && xtmp<xmaxval) 
+              {
+                xg[0]= xm;  yg[0]= ym;  
+                if (Ishidden(psubwin)) 
+                { xg[1]= xm; yg[1]= iybox[2] -iybox[3]+ym; }
+                else
+                {xg[1]= ixbox[3] - ixbox[4] +xm; yg[1]= iybox[3] - iybox[4] +ym; } 
+                C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                xg[0]= xg[1]; yg[0]= yg[1];
+                xg[1] = ixbox[3] - ixbox[4] +xm; 
+                yg[1]=  iybox[2] - iybox[4] +ym;
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
+              }
+            }  
+          }
+
+          /* and subtics */
+          if(i != nbtics-1) /* F.Leray NEW 03.11.04 */
+          {
+
+            if(ppsubwin->logflags[0] =='l')
+            {
+              double tmp[2];
+              double pas=0;
+              double * tmp_log_grads = (double *) NULL;
+
+
+              double * grads = ppsubwin->axes.xgrads;
+
+              tmp[0] = exp10(grads[i]);
+              tmp[1] = exp10(grads[i+1]);
+              pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
+
+              if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
+                sciprint("Error allocating tmp_log_grads\n");
+                return -1;
+              }
+
+              for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
+
+              for(j=0;j<nbsubtics;j++)
+              {
+                vxx1 = tmp_log_grads[j];
+
+                if(vxx1<xminval || vxx1>xmaxval) continue;
+
+                if(ppsubwin->axes.reverse[0] == TRUE)
+                  vxx1 = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],vxx1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&vxx1,&fy,&fz);
+
+                if (IsDownAxes(psubwin))
+                {
+                  vx[1]=vx[0]=xm;
+                  vy[0]=ym;
+                  vy[1]=vy[0]+iof/4;
+                }
+                else
+                {
+                  vx[0]=xm;vy[0]=ym;
+                  vx[1]= (integer) (vx[0]+barlengthx/2.0);
+                  vy[1]= (integer) (vy[0]+barlengthy/2.0);
+                }
+
+                if( ppsubwin->axes.axes_visible[0] )
+                  C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              }
+
+              FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
+            } /* end NEW */
+            else
+            {
+              double xtmp2 = ppsubwin->axes.xgrads[i];
+              double dx = (ppsubwin->axes.xgrads[i+1] - ppsubwin->axes.xgrads[i]) / nbsubtics;
+
+              for (j=1;j<nbsubtics;j++)
+              {  
+                vxx1=xtmp2+dx*j;
+
+                if(vxx1<xminval || vxx1>xmaxval) continue;
+
+                if(ppsubwin->axes.reverse[0] == TRUE)
+                  vxx1 = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],vxx1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&vxx1,&fy,&fz);
+
+                if (IsDownAxes(psubwin))
+                {
+                  vx[1]=vx[0]=xm;
+                  vy[0]=ym;
+                  vy[1]=vy[0]+iof/4;
+                }
+                else
+                {
+                  vx[0]=xm;vy[0]=ym;
+                  vx[1]= (integer) (vx[0]+barlengthx/2.0);
+                  vy[1]= (integer) (vy[0]+barlengthy/2.0);
+                }
+
+                if(ppsubwin->axes.axes_visible[0] == TRUE)
+                  C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              }
+            }
+          }
+
+          /***************************************************************/
+          /************************* END OF COMMON PART ******************/
+          /***************************************************************/
+
+        }
+      }
+    }
+    if ( sciGetVisibility(ppsubwin->mon_x_label) )
+    {
+      sciLabel * ppLabel = pLABEL_FEATURE( ppsubwin->mon_x_label ) ;
+      if( ppLabel->auto_rotation )
+      {
+        sciSetFontOrientation(ppsubwin->mon_x_label, 0) ;
+      }
+
+
+      if( ppLabel->auto_position )
+      {
+
+        int segmentStart[2] = { ixbox[4], iybox[4] } ;
+        int segmentEnd[2]   = { ixbox[5], iybox[5] } ;
+
+        /* add the bar size and ticks label size to the offset */
+        int offset[2] = { constOffset[0] + maxTicksLabelSize[0] + abs( barlengthx ), 
+          constOffset[1] + maxTicksLabelSize[1] + abs( barlengthy )  } ;
+        computeLabelAutoPos( ppsubwin->mon_x_label, segmentStart, segmentEnd, offset ) ;
+      }
+      /* a trick to force the display with 2d scale */
+      drawTextEntity( ppLabel->text ) ;
+
+    }
+  }
+  else
+  {
+
+    if ( pSUBWIN_FEATURE (psubwin)->project[1]==1) /* y is HERE */
+    {
+      double fx,fy,fz; 
+      char c_format[5];
+
+      integer Ticsdir[2];
+      Ticsdir[0]=ixbox[4]-ixbox[3];
+      Ticsdir[1]=iybox[4]-iybox[3];
+      BBoxToval(&fx,&fy,&fz,xind[4],bbox);
+
+      x=inint((ixbox[4]+ixbox[5])/2+1.5*rect[2] +iof);
+      y=inint(((2/3.0)*iybox[4]+(1/3.0)*iybox[5])+1.5*rect[3]+iof);
+
+      if(ppsubwin->axes.auto_ticks[1] == FALSE)
+      {
+        /* we display the y tics specified by the user*/
+        nbtics = ppsubwin->axes.u_nygrads;
+        nbsubtics = ppsubwin->axes.nbsubtics[1];
+
+        maxTicksLabelSize[0] = 0 ;
+        maxTicksLabelSize[1] = 0 ;
+
+        for(i=0;i<nbtics;i++)
+        {
+          char *foo = ppsubwin->axes.u_ylabels[i]; 
+          double ytmp = ppsubwin->axes.u_ygrads[i];
+
+          if(ytmp<yminval || ytmp>ymaxval) 
+          {
+            /*   sciprint("je rejete la valeur: %lf\n\n",xtmp); */
+            continue; /* cas ou TL est ON et on a des graduations qui ne seront pas affichees de tte facon */
+            /* donc autant ne pas aller plus loin dans l'algo... */
+          }
+
+
+          /***************************************************************/
+          /************************* COMMON PART *************************/
+          /***************************************************************/
+
+          if(ppsubwin->axes.reverse[1] == TRUE)
+            ytmp = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],ytmp);
+
+          ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&ytmp,&fz);
+          /*             trans3d(psubwin,1,&xm,&ym,&fx,&ytmp,&fz); */
+
+
+
+          vx[0]=xm;vy[0]=ym;
+
+          barlengthx= (integer) (( Ticsdir[0])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
+          barlengthy= (integer) (( Ticsdir[1])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
+          /*   NumberFormat(foo,((integer) (yy[0] + i*ceil((yy[1]-yy[0])/yy[3]))), */
+          /*                        ((integer) yy[2])); */
+          C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); /* fix bug noticed by R.N. */
+
+          /* get the size of the ticks */
+          C2F(dr)("xstringl",foo,&x,&y,rect,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+          maxTicksLabelSize[0] = Max( maxTicksLabelSize[0], rect[2] ) ;
+          maxTicksLabelSize[1] = Max( maxTicksLabelSize[1], rect[3] ) ;
+
+
+          if (IsDownAxes(psubwin)){
+            vx[1]=vx[0];
+            vy[1]=vy[0]+iof/2;
+            posi[0] = inint(xm-rect[2]/2); 
+            posi[1]=inint( vy[0] + iof + rect[3]);}
+          else{ 
+            vx[1]=vx[0]+barlengthx;
+            vy[1]=vy[0]+barlengthy;
+            /*                     posi[0] = inint( xm+2*barlengthx - rect[2]/2); */
+            /*                     posi[0] = inint( xm+2*barlengthx - rect[2]); */
+            posi[0] = inint( xm+2*barlengthx);
+            posi[1]=inint( ym + 2*barlengthy + rect[3]);}
+
+          if(ppsubwin->axes.axes_visible[1] == TRUE){
+            C2F(dr)("xset","pattern",&textcolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            C2F(dr)("xstring",foo,&(posi[0]),&(posi[1]),PI0,&flag,PI0,PI0,&ang, PD0,PD0,PD0,0L,0L);
+            C2F(dr)("xset","pattern",&ticscolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
+            C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+          }
+          /* grid to put here */
+          if ( ppsubwin->grid[1] > -1 && ppsubwin->axes.axes_visible[1] )
+          {
+            gstyle = pSUBWIN_FEATURE (psubwin)->grid[1];
+
+            if((ppsubwin->logflags[1] =='l') && (i != nbtics-1))
+            {
+              double tmp[2];
+              double pas=0;
+              double * tmp_log_grads = (double *) NULL;
+
+
+              double * grads = ppsubwin->axes.u_ygrads;
+
+              tmp[0] = exp10(grads[i]);
+              tmp[1] = exp10(grads[i+1]);
+              pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
+
+              if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
+                sciprint("Error allocating tmp_log_grads\n");
+                return -1;
+              }
+
+              for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
+
+              for(j=0;j<nbsubtics;j++)
+              {
+                vyy1 = tmp_log_grads[j];
+
+                if(vyy1<=yminval || vyy1>=ymaxval) continue;
+
+                if(ppsubwin->axes.reverse[1] == TRUE)
+                  vyy1 = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],vyy1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&vyy1,&fz);
+
+                /*  if ((xm != ixbox[5]) && (xm != ixbox[4])) */
+                /*                             {  */
+                xg[0]= xm;  yg[0]= ym;  
+                if (Ishidden(psubwin))
+                { xg[1]= xm; yg[1]= iybox[2] -iybox[3]+ym; }
+                else
+                {xg[1]= ixbox[3] - ixbox[4] +xm; yg[1]= iybox[3] - iybox[4] +ym; } 
+                C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                xg[0]= xg[1]; yg[0]= yg[1];
+                xg[1] = ixbox[3] - ixbox[4] +xm; 
+                yg[1]=  iybox[2] - iybox[4] +ym;
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
+                /*     } */
+              }
+              FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
+            }
+            else
+            {
+              if(ytmp>yminval && ytmp<ymaxval) 
+              {
+                xg[0]= xm;  yg[0]= ym;  
+                if (Ishidden(psubwin))
+                { xg[1]= xm; yg[1]= iybox[2] -iybox[3]+ym; }
+                else
+                {xg[1]= ixbox[3] - ixbox[4] +xm; yg[1]= iybox[3] - iybox[4] +ym; } 
+                C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                xg[0]= xg[1]; yg[0]= yg[1];
+                xg[1] = ixbox[3] - ixbox[4] +xm; 
+                yg[1]=  iybox[2] - iybox[4] +ym;
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
+              }
+            }
+          }
+
+          /* and subtics */
+          if(i != nbtics-1)
+          {
+            if(ppsubwin->logflags[1] =='l')
+            {
+              double tmp[2];
+              double pas=0;
+              double * tmp_log_grads = (double *) NULL;
+
+
+              double * grads = ppsubwin->axes.u_ygrads;
+
+              tmp[0] = exp10(grads[i]);
+              tmp[1] = exp10(grads[i+1]);
+              pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
+
+              if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
+                sciprint("Error allocating tmp_log_grads\n");
+                return -1;
+              }
+
+              for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
+
+              for(j=0;j<nbsubtics;j++)
+              {
+                vyy1 = tmp_log_grads[j];
+
+                if(vyy1<yminval || vyy1>ymaxval) continue;
+
+                if(ppsubwin->axes.reverse[1] == TRUE)
+                  vyy1 = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],vyy1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&vyy1,&fz);
+
+                if (IsDownAxes(psubwin))
+                {
+                  vx[1]=vx[0]=xm;
+                  vy[0]=ym;
+                  vy[1]=vy[0]+iof/4;
+                }
+                else
+                {
+                  vx[0]=xm;vy[0]=ym;
+                  vx[1]= (integer) (vx[0]+barlengthx/2.0);
+                  vy[1]= (integer) (vy[0]+barlengthy/2.0);
+                }
+
+                if(ppsubwin->axes.axes_visible[1] == TRUE)
+                  C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              }
+              FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
+
+            } /* end NEW */
+            else
+            {
+              double ytmp2 = ppsubwin->axes.u_ygrads[i];
+              double dy = (ppsubwin->axes.u_ygrads[i+1] - ppsubwin->axes.u_ygrads[i]) / nbsubtics;
+              for(j=0;j<nbsubtics;j++)
+              {
+                vyy1=ytmp2+dy*j;
+
+                if(vyy1<yminval || vyy1>ymaxval) continue;
+
+                if(ppsubwin->axes.reverse[1] == TRUE)
+                  vyy1 = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],vyy1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&vyy1,&fz);
+
+                if (IsDownAxes(psubwin))
+                {
+                  vx[1]=vx[0]=xm;
+                  vy[0]=ym;
+                  vy[1]=vy[0]+iof/4;
+                }
+                else
+                {
+                  vx[0]=xm;vy[0]=ym;
+                  vx[1]= (integer) (vx[0]+barlengthx/2.0);
+                  vy[1]= (integer) (vy[0]+barlengthy/2.0);
+                }
+
+                if(ppsubwin->axes.axes_visible[1] == TRUE)
+                  C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              }
+            }
+          }
+
+          /***************************************************************/
+          /************************* END OF COMMON PART ******************/
+          /***************************************************************/
+        }
+      }
+      else /* we display the computed tics */
+      {
+        AdaptGraduationsOnYBottomRight(iof,x,y,size,Ticsdir,fontid,psubwin,yminval,ymaxval,fx,0.,fz);
+
+        lastyindex = ppsubwin->axes.nygrads - 1;
+
+        if(lastyindex == 0)
+          ChooseFormatForOneGrad(c_format,&(ppsubwin->axes.ygrads[0]));
+        else
+          ChoixFormatE(c_format,
+          ppsubwin->axes.ygrads[0],
+          ppsubwin->axes.ygrads[lastyindex],
+          ((ppsubwin->axes.ygrads[lastyindex])-(ppsubwin->axes.ygrads[0]))/(lastyindex));
+
+        nbtics = ppsubwin->axes.nygrads;
+        nbsubtics = ppsubwin->axes.nbsubtics[1];
+
+        maxTicksLabelSize[0] = 0 ;
+        maxTicksLabelSize[1] = 0 ;
+
+        for(i=0;i<nbtics;i++)
+        {
+          char foo[256]; 
+          double ytmp2 = ppsubwin->axes.ygrads[i];
+
+          if(ytmp2<yminval || ytmp2>ymaxval) 
+          {
+            /*   sciprint("je rejete la valeur: %lf\n\n",xtmp); */
+            continue; /* cas ou TL est ON et on a des graduations qui ne seront pas affichees de tte facon */
+            /* donc autant ne pas aller plus loin dans l'algo... */
+          }
+
+          sprintf(foo,c_format,ytmp2);
+
+          /***************************************************************/
+          /************************* COMMON PART *************************/
+          /***************************************************************/
+
+          /* F.Leray 03.11.04 Test if log scale to perform a : exp10(x) because trans3d will */
+          /* re-do a log10() (that is needed for data computations) */
+
+
+          if(ppsubwin->axes.reverse[1] == TRUE)
+            ytmp2 = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],ytmp2);
+
+          ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&ytmp2,&fz);
+
+
+          vx[0]=xm;vy[0]=ym;
+
+          barlengthx= (integer) (( Ticsdir[0])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
+          barlengthy= (integer) (( Ticsdir[1])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
+
+          C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); /* fix bug noticed by R.N. */
+
+
+          C2F(dr)("xstringl",foo,&x,&y,rect,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+          maxTicksLabelSize[0] = Max( maxTicksLabelSize[0], rect[2] ) ;
+          maxTicksLabelSize[1] = Max( maxTicksLabelSize[1], rect[3] ) ;
+
+          if (IsDownAxes(psubwin)){
+            vx[1]=vx[0];
+            vy[1]=vy[0]+iof/2;
+            posi[0] = inint(xm-rect[2]/2); 
+            posi[1]=inint( vy[0] + iof + rect[3]);}
+          else{ 
+            vx[1]=vx[0]+barlengthx;
+            vy[1]=vy[0]+barlengthy;
+            /*                     posi[0] = inint( xm+2*barlengthx - rect[2]/2); */
+            /*                     posi[0] = inint( xm+2*barlengthx - rect[2]); */
+            posi[0] = inint( xm+2*barlengthx);
+            posi[1]=inint( ym + 2*barlengthy + rect[3]);}
+
+          if(ppsubwin->axes.axes_visible[1] == TRUE){
+            C2F(dr)("xset","pattern",&textcolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            if ( ppsubwin->logflags[1] == 'l' )
+            {
+              int smallersize = fontid[1]-2;
+              int old_rect10[4];
+              /*                   char str[2] = "xv"; */
+              int posi10[2];
+
+              posi10[0] = posi[0] - logrect[2];
+              posi10[1] = posi[1] + logrect[3];
+
+              C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              C2F(dr)("xstring","10",(&posi10[0]),(&posi10[1]),PI0,&flag,PI0,PI0,&angle,PD0,PD0,PD0,0L,0L);
+
+              C2F(dr)("xstringl","10",(&posi10[0]),(&posi10[1]),old_rect10,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+
+              posi[0] = old_rect10[0] + old_rect10[2];
+              posi[1] = (int) (old_rect10[1] - old_rect10[3]*.1);
+
+              C2F(dr)("xset","font",fontid,&smallersize,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              C2F(dr)("xstring",foo,&(posi[0]),&(posi[1]),PI0,&flag,PI0,PI0,&ang, PD0,PD0,PD0,0L,0L);
+
+              /* put back the current fontid */
+              C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            }
+            else
+              C2F(dr)("xstring",foo,&(posi[0]),&(posi[1]),PI0,&flag,PI0,PI0,&ang, PD0,PD0,PD0,0L,0L);
+
+            C2F(dr)("xset","pattern",&ticscolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
+            C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+          }
+
+          /* grid to put here */
+
+          if ( ppsubwin->grid[1] > -1 && ppsubwin->axes.axes_visible[1] )
+          {
+            gstyle = pSUBWIN_FEATURE (psubwin)->grid[1];
+
+            if((ppsubwin->logflags[1] =='l') && (i != nbtics-1))
+            {
+              double tmp[2];
+              double pas=0;
+              double * tmp_log_grads = (double *) NULL;
+
+
+              double * grads = ppsubwin->axes.ygrads;
+
+              tmp[0] = exp10(grads[i]);
+              tmp[1] = exp10(grads[i+1]);
+              pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
+
+              if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
+                sciprint("Error allocating tmp_log_grads\n");
+                return -1;
+              }
+
+              for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
+
+              for(j=0;j<nbsubtics;j++)
+              {
+                vyy1 = tmp_log_grads[j];
+
+                if(vyy1<=yminval || vyy1>=ymaxval) continue;
+
+                if(ppsubwin->axes.reverse[1] == TRUE)
+                  vyy1 = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],vyy1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&vyy1,&fz);
+
+                /*  if ((xm != ixbox[5]) && (xm != ixbox[4])) */
+                /*                             {  */
+                xg[0]= xm;  yg[0]= ym;  
+                if (Ishidden(psubwin))
+                { xg[1]= xm; yg[1]= iybox[2] -iybox[3]+ym; }
+                else
+                {xg[1]= ixbox[3] - ixbox[4] +xm; yg[1]= iybox[3] - iybox[4] +ym; } 
+                C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                xg[0]= xg[1]; yg[0]= yg[1];
+                xg[1] = ixbox[3] - ixbox[4] +xm; 
+                yg[1]=  iybox[2] - iybox[4] +ym;
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
+                /*     } */
+              }
+              FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
+            }
+            else
+            {
+              if(ytmp2>yminval && ytmp2<ymaxval) 
+              {
+                xg[0]= xm;  yg[0]= ym;  
+                if (Ishidden(psubwin))
+                { xg[1]= xm; yg[1]= iybox[2] -iybox[3]+ym; }
+                else
+                {xg[1]= ixbox[3] - ixbox[4] +xm; yg[1]= iybox[3] - iybox[4] +ym; } 
+                C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                xg[0]= xg[1]; yg[0]= yg[1];
+                xg[1] = ixbox[3] - ixbox[4] +xm; 
+                yg[1]=  iybox[2] - iybox[4] +ym;
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
+              }
+            }
+          }
+
+          /* and subtics */
+          if(i != nbtics-1)
+          {
+            if(ppsubwin->logflags[1] =='l')
+            {
+              double tmp[2];
+              double pas=0;
+              double * tmp_log_grads = (double *) NULL;
+
+
+              double * grads = ppsubwin->axes.ygrads;
+
+              tmp[0] = exp10(grads[i]);
+              tmp[1] = exp10(grads[i+1]);
+              pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
+
+              if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
+                sciprint("Error allocating tmp_log_grads\n");
+                return -1;
+              }
+
+              for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
+
+              for(j=0;j<nbsubtics;j++)
+              {
+                vyy1 = tmp_log_grads[j];
+
+                if(vyy1<yminval || vyy1>ymaxval) continue;
+
+                if(ppsubwin->axes.reverse[1] == TRUE)
+                  vyy1 = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],vyy1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&vyy1,&fz);
+
+                if (IsDownAxes(psubwin))
+                {
+                  vx[1]=vx[0]=xm;
+                  vy[0]=ym;
+                  vy[1]=vy[0]+iof/4;
+                }
+                else
+                {
+                  vx[0]=xm;vy[0]=ym;
+                  vx[1]= (integer) (vx[0]+barlengthx/2.0);
+                  vy[1]= (integer) (vy[0]+barlengthy/2.0);
+                }
+
+                if(ppsubwin->axes.axes_visible[1] == TRUE)
+                  C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              }
+              FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
+
+            } /* end NEW */
+            else
+            {
+              double ytmp3 = ppsubwin->axes.ygrads[i];
+              double dy = (ppsubwin->axes.ygrads[i+1] - ppsubwin->axes.ygrads[i]) / nbsubtics;
+              for(j=0;j<nbsubtics;j++)
+              {
+                vyy1=ytmp3+dy*j;
+
+                if(vyy1<yminval || vyy1>ymaxval) continue;
+
+                if(ppsubwin->axes.reverse[1] == TRUE)
+                  vyy1 = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],vyy1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&vyy1,&fz);
+                /*   trans3d(psubwin,1,&xm,&ym,&fx,&vyy1,&fz); */
+
+                if (IsDownAxes(psubwin))
+                {
+                  vx[1]=vx[0]=xm;
+                  vy[0]=ym;
+                  vy[1]=vy[0]+iof/4;
+                }
+                else
+                {
+                  vx[0]=xm;vy[0]=ym;
+                  vx[1]= (integer) (vx[0]+barlengthx/2.0);
+                  vy[1]= (integer) (vy[0]+barlengthy/2.0);
+                }
+
+                if(ppsubwin->axes.axes_visible[1] == TRUE)
+                  C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              }
+            }
+          }
+          /***************************************************************/
+          /************************* END OF COMMON PART ******************/
+          /***************************************************************/
+
+        }
+      }
+    }
+    if ( sciGetVisibility(ppsubwin->mon_y_label) )
+    {
+      sciLabel * ppLabel = pLABEL_FEATURE( ppsubwin->mon_y_label ) ;
+      if( ppLabel->auto_rotation )
+      {
+        sciSetFontOrientation( ppsubwin->mon_y_label, 0 ) ;
+      }
+
+      if( ppLabel->auto_position )
+      {
+
+        int segmentStart[2] = { ixbox[4], iybox[4] } ;
+        int segmentEnd[2]   = { ixbox[5], iybox[5] } ;
+
+        /* add the bar size and ticks label size to the offset */
+        int offset[2] = { constOffset[0] + maxTicksLabelSize[0] + abs( barlengthx ), 
+          constOffset[1] + maxTicksLabelSize[1] + abs( barlengthy )  } ;
+        computeLabelAutoPos( ppsubwin->mon_y_label, segmentStart, segmentEnd, offset ) ;
+      }
+      /* a trick to force the display with 2d scale */
+      drawTextEntity( ppLabel->text ) ;
+
+    }
+  }
+
+
+
+  /***********************/ /** bottom left side ***/
+  /*** le  x-y scaling ***/ /* DISPLAY x or y graduations */
+  /***********************/
+
+  if (( xind[3]+xind[4] == 3) || ( xind[3]+xind[4] == 11))
+  {
+    if (pSUBWIN_FEATURE (psubwin)->project[0]==1) /* x HERE */
+    {
+      double fx,fy,fz;
+      char c_format[5];
+
+
+      integer Ticsdir[2];
+      Ticsdir[0]=ixbox[4]-ixbox[5];
+      Ticsdir[1]=iybox[4]-iybox[5];
+      BBoxToval(&fx,&fy,&fz,xind[3],bbox);
+
+      x=inint((ixbox[3]+ixbox[4])/2.0 -rect[2] -iof);
+      y=inint((1/3.0)*iybox[3]+(2/3.0)*iybox[4]+ iof+ 1.5*rect[3]); 
+
+      if(ppsubwin->axes.auto_ticks[0] == FALSE)
+      {
+        /* we display the x tics specified by the user*/
+        nbtics = ppsubwin->axes.u_nxgrads;
+        nbsubtics = ppsubwin->axes.nbsubtics[0];
+
+        maxTicksLabelSize[0] = 0 ;
+        maxTicksLabelSize[1] = 0 ;
+
+        for(i=0;i<nbtics;i++)
+        {
+          char *foo = ppsubwin->axes.u_xlabels[i]; 
+          double xtmp = ppsubwin->axes.u_xgrads[i];
+
+          if(xtmp<xminval || xtmp>xmaxval) 
+          {
+            /*   sciprint("je rejete la valeur: %lf\n\n",xtmp); */
+            continue; /* cas ou TL est ON et on a des graduations qui ne seront pas affichees de tte facon */
+            /* donc autant ne pas aller plus loin dans l'algo... */
+          }
+
+          /***************************************************************/
+          /************************* COMMON PART *************************/
+          /***************************************************************/
+
+          if(ppsubwin->axes.reverse[0] == TRUE)
+            xtmp = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],xtmp);
+
+          ComputeGoodTrans3d(psubwin,1,&xm,&ym,&xtmp,&fy,&fz);
+          /*             trans3d(psubwin,1,&xm,&ym,&xtmp,&fy,&fz); */
+
+
+          vx[0]=xm;vy[0]=ym;
+
+          barlengthx= (integer) (( Ticsdir[0])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
+          barlengthy= (integer) (( Ticsdir[1])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
+
+          C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); /* fix bug noticed by R.N. */
+
+          C2F(dr)("xstringl",foo,&x,&y,rect,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+          maxTicksLabelSize[0] = Max( maxTicksLabelSize[0], rect[2] ) ;
+          maxTicksLabelSize[1] = Max( maxTicksLabelSize[1], rect[3] ) ;
+
+
+          if (IsDownAxes(psubwin)){
+            vx[1]=vx[0];
+            vy[1]=vy[0]+iof/2;
+            posi[0] = inint(xm-rect[2]/2); 
+            posi[1]=inint( vy[0] + iof + rect[3]);}
+          else{
+            vx[1]=vx[0]+barlengthx;
+            vy[1]=vy[0]+barlengthy;
+            posi[0] = inint( xm+2*barlengthx-rect[2]); 
+            posi[1]=inint( ym + 2*barlengthy + rect[3]);}
+
+          if(ppsubwin->axes.axes_visible[0] == TRUE){
+            C2F(dr)("xset","pattern",&textcolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            C2F(dr)("xstring",foo,&(posi[0]),&(posi[1]),PI0,&flag,PI0,PI0,&ang, PD0,PD0,PD0,0L,0L);
+            C2F(dr)("xset","pattern",&ticscolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);   
+            C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+          }
+          /* grid to put here */
+          if ( ppsubwin->grid[0] > -1 && ppsubwin->axes.axes_visible[0]  )
+          {
+            gstyle = pSUBWIN_FEATURE (psubwin)->grid[0];
+
+            if((ppsubwin->logflags[0] =='l') && (i != nbtics-1))
+            {
+              double tmp[2];
+              double pas=0;
+              double * tmp_log_grads = (double *) NULL;
+
+
+              double * grads = ppsubwin->axes.u_xgrads;
+
+              tmp[0] = exp10(grads[i]);
+              tmp[1] = exp10(grads[i+1]);
+              pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
+
+              if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
+                sciprint("Error allocating tmp_log_grads\n");
+                return -1;
+              }
+
+              for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
+
+              for(j=0;j<nbsubtics;j++)
+              {
+                vxx1 = tmp_log_grads[j];
+
+                if(vxx1<=xminval || vxx1>=xmaxval) continue;
+
+                if(ppsubwin->axes.reverse[0] == TRUE)
+                  vxx1 = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],vxx1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&vxx1,&fy,&fz);
+
+                /*   if ((xm != ixbox[3]) && (xm != ixbox[4])) */
+                /*                             {  */
+                xg[0]= xm;  yg[0]= ym;  
+                if (Ishidden(psubwin))
+                { xg[1]= xm; yg[1]= iybox[0] -iybox[5]+ym; }
+                else
+                {xg[1]= ixbox[1] - ixbox[3] +xm; yg[1]= iybox[5] - iybox[4] +ym; } 
+                C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                xg[0]= xg[1]; yg[0]= yg[1];
+                xg[1] = ixbox[1] - ixbox[3] +xm; yg[1]=  iybox[0] - iybox[4] +ym;
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
+                /*     } */
+              }
+              FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
+            }
+            else
+            {
+              if(xtmp>xminval && xtmp<xmaxval) 
+              {
+                xg[0]= xm;  yg[0]= ym;  
+                if (Ishidden(psubwin))
+                { xg[1]= xm; yg[1]= iybox[0] -iybox[5]+ym; }
+                else
+                {xg[1]= ixbox[1] - ixbox[3] +xm; yg[1]= iybox[5] - iybox[4] +ym; } 
+                C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                xg[0]= xg[1]; yg[0]= yg[1];
+                xg[1] = ixbox[1] - ixbox[3] +xm; yg[1]=  iybox[0] - iybox[4] +ym;
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
+              }
+            }
+          }
+
+          /* and subtics */
+          if(i != nbtics-1)
+          {
+            if(ppsubwin->logflags[0] =='l')
+            {
+              double tmp[2];
+              double pas=0;
+              double * tmp_log_grads = (double *) NULL;
+
+
+              double * grads = ppsubwin->axes.u_xgrads;
+
+              tmp[0] = exp10(grads[i]);
+              tmp[1] = exp10(grads[i+1]);
+              pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
+
+              if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
+                sciprint("Error allocating tmp_log_grads\n");
+                return -1;
+              }
+
+              for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
+
+              for(j=0;j<nbsubtics;j++)
+              {
+                vxx1 = tmp_log_grads[j];
+
+                if(vxx1<xminval || vxx1>xmaxval) continue;
+
+                if(ppsubwin->axes.reverse[0] == TRUE)
+                  vxx1 = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],vxx1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&vxx1,&fy,&fz);
+
+                if (IsDownAxes(psubwin))
+                {
+                  vx[1]=vx[0]=xm;
+                  vy[0]=ym;
+                  vy[1]=vy[0]+iof/4;
+                }
+                else
+                {
+                  vx[0]=xm;vy[0]=ym;
+                  vx[1]= (integer) (vx[0]+barlengthx/2.0);
+                  vy[1]= (integer) (vy[0]+barlengthy/2.0);
+                }
+
+                if(ppsubwin->axes.axes_visible[0] == TRUE)
+                  C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              }
+
+              FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
+            } /* end NEW */
+            else
+            {
+              double xtmp2 = ppsubwin->axes.u_xgrads[i];
+              double dx = (ppsubwin->axes.u_xgrads[i+1] - ppsubwin->axes.u_xgrads[i]) / nbsubtics;
+
+              for (j=1;j<nbsubtics;j++)
+              {  
+                vxx1=xtmp2+dx*j;
+
+                if(vxx1<xminval || vxx1>xmaxval) continue;
+
+                if(ppsubwin->axes.reverse[0] == TRUE)
+                  vxx1 = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],vxx1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&vxx1,&fy,&fz);
+                /*               trans3d(psubwin,1,&xm,&ym,&vxx1,&fy,&fz); */
+
+
+                if (IsDownAxes(psubwin))
+                {
+                  vx[1]=vx[0]=xm;
+                  vy[0]=ym;
+                  vy[1]=vy[0]+iof/4;
+                }
+                else
+                {
+                  vx[0]=xm;vy[0]=ym;
+                  vx[1]= (integer) (vx[0]+barlengthx/2.0);
+                  vy[1]= (integer) (vy[0]+barlengthy/2.0);
+                }
+
+                if(ppsubwin->axes.axes_visible[0] == TRUE)
+                  C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              }
+            }
+          }
+          /***************************************************************/
+          /************************* COMMON PART *************************/
+          /***************************************************************/
+
+
+        }
+
+      }
+      else /* we display the computed tics */
+      {
+        AdaptGraduationsOnXBottomLeft(iof,x,y,size,Ticsdir,fontid,psubwin,xminval,xmaxval,0.,fy,fz);
+
+        lastxindex = ppsubwin->axes.nxgrads - 1;
+
+        if(lastxindex == 0)
+          ChooseFormatForOneGrad(c_format,&(ppsubwin->axes.xgrads[0]));
+        else
+          ChoixFormatE(c_format,
+          ppsubwin->axes.xgrads[0],
+          ppsubwin->axes.xgrads[lastxindex],
+          ((ppsubwin->axes.xgrads[lastxindex])-(ppsubwin->axes.xgrads[0]))/(lastxindex));
+
+        nbtics = ppsubwin->axes.nxgrads;
+        nbsubtics = ppsubwin->axes.nbsubtics[0];
+
+        maxTicksLabelSize[0] = 0 ;
+        maxTicksLabelSize[1] = 0 ;
+
+        for(i=0;i<nbtics;i++)
+        {
+          char foo[256]; 
+          double xtmp = ppsubwin->axes.xgrads[i];
+
+          if(xtmp<xminval || xtmp>xmaxval) 
+          {
+            /*   sciprint("je rejete la valeur: %lf\n\n",xtmp); */
+            continue; /* cas ou TL est ON et on a des graduations qui ne seront pas affichees de tte facon */
+            /* donc autant ne pas aller plus loin dans l'algo... */
+          }
+
+          sprintf(foo,c_format,xtmp);
+
+          /***************************************************************/
+          /************************* COMMON PART *************************/
+          /***************************************************************/
+
+          if(ppsubwin->axes.reverse[0] == TRUE)
+            xtmp = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],xtmp);
+
+          ComputeGoodTrans3d(psubwin,1,&xm,&ym,&xtmp,&fy,&fz);
+
+          vx[0]=xm;vy[0]=ym;
+
+          barlengthx= (integer) (( Ticsdir[0])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
+          barlengthy= (integer) (( Ticsdir[1])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
+
+          C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); /* fix bug noticed by R.N. */
+
+          C2F(dr)("xstringl",foo,&x,&y,rect,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+          maxTicksLabelSize[0] = Max( maxTicksLabelSize[0], rect[2] ) ;
+          maxTicksLabelSize[1] = Max( maxTicksLabelSize[1], rect[3] ) ;
+
+          if (IsDownAxes(psubwin)){
+            vx[1]=vx[0];
+            vy[1]=vy[0]+iof/2;
+            posi[0] = inint(xm-rect[2]/2); 
+            posi[1]=inint( vy[0] + iof + rect[3]);}
+          else{
+            vx[1]=vx[0]+barlengthx;
+            vy[1]=vy[0]+barlengthy;
+            posi[0] = inint( xm+2*barlengthx-rect[2]); 
+            posi[1]=inint( ym + 2*barlengthy + rect[3]);}
+
+          if(ppsubwin->axes.axes_visible[0] == TRUE){
+            C2F(dr)("xset","pattern",&textcolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            if ( ppsubwin->logflags[0] == 'l' )
+            {
+              int smallersize = fontid[1]-2;
+              int old_rect10[4];
+              int posi10[2];
+
+              posi10[0] = posi[0] - logrect[2];
+              posi10[1] = posi[1] + logrect[3];
+
+              C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              C2F(dr)("xstring","10",(&posi10[0]),(&posi10[1]),PI0,&flag,PI0,PI0,&angle,PD0,PD0,PD0,0L,0L);
+
+              C2F(dr)("xstringl","10",(&posi10[0]),(&posi10[1]),old_rect10,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+
+              posi[0] = old_rect10[0] + old_rect10[2];
+              posi[1] = (int) (old_rect10[1] - old_rect10[3]*.1);
+
+              C2F(dr)("xset","font",fontid,&smallersize,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              C2F(dr)("xstring",foo,&(posi[0]),&(posi[1]),PI0,&flag,PI0,PI0,&ang, PD0,PD0,PD0,0L,0L);
+
+              /* put back the current fontid */
+              C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            }
+            else
+              C2F(dr)("xstring",foo,&(posi[0]),&(posi[1]),PI0,&flag,PI0,PI0,&ang, PD0,PD0,PD0,0L,0L);
+
+            C2F(dr)("xset","pattern",&ticscolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);   
+            C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+          }
+          /* grid to put here */
+          if ( ppsubwin->grid[0] > -1 && ppsubwin->axes.axes_visible[0] )
+          {
+            gstyle = pSUBWIN_FEATURE (psubwin)->grid[0];
+
+            if((ppsubwin->logflags[0] =='l') && (i != nbtics-1))
+            {
+              double tmp[2];
+              double pas=0;
+              double * tmp_log_grads = (double *) NULL;
+
+
+              double * grads = ppsubwin->axes.xgrads;
+
+              tmp[0] = exp10(grads[i]);
+              tmp[1] = exp10(grads[i+1]);
+              pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
+
+              if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
+                sciprint("Error allocating tmp_log_grads\n");
+                return -1;
+              }
+
+              for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
+
+              for(j=0;j<nbsubtics;j++)
+              {
+                vxx1 = tmp_log_grads[j];
+
+                if(vxx1<=xminval || vxx1>=xmaxval) continue;
+
+                if(ppsubwin->axes.reverse[0] == TRUE)
+                  vxx1 = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],vxx1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&vxx1,&fy,&fz);
+
+
+                xg[0]= xm;  yg[0]= ym;  
+                if (Ishidden(psubwin))
+                { xg[1]= xm; yg[1]= iybox[0] -iybox[5]+ym; }
+                else
+                {xg[1]= ixbox[1] - ixbox[3] +xm; yg[1]= iybox[5] - iybox[4] +ym; } 
+                C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                xg[0]= xg[1]; yg[0]= yg[1];
+                xg[1] = ixbox[1] - ixbox[3] +xm; yg[1]=  iybox[0] - iybox[4] +ym;
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
+
+              }
+              FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
+            }
+            else
+            {
+              if(xtmp>xminval && xtmp<xmaxval) 
+              {
+                xg[0]= xm;  yg[0]= ym;  
+                if (Ishidden(psubwin))
+                { xg[1]= xm; yg[1]= iybox[0] -iybox[5]+ym; }
+                else
+                {xg[1]= ixbox[1] - ixbox[3] +xm; yg[1]= iybox[5] - iybox[4] +ym; } 
+                C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                xg[0]= xg[1]; yg[0]= yg[1];
+                xg[1] = ixbox[1] - ixbox[3] +xm; yg[1]=  iybox[0] - iybox[4] +ym;
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
+              }
+            }
+          }
+
+          /* and subtics */
+          if(i != nbtics-1)
+          {
+            if(ppsubwin->logflags[0] =='l')
+            {
+              double tmp[2];
+              double pas=0;
+              double * tmp_log_grads = (double *) NULL;
+
+
+              double * grads = ppsubwin->axes.xgrads;
+
+              tmp[0] = exp10(grads[i]);
+              tmp[1] = exp10(grads[i+1]);
+              pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
+
+              if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
+                sciprint("Error allocating tmp_log_grads\n");
+                return -1;
+              }
+
+              for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
+
+              for(j=0;j<nbsubtics;j++)
+              {
+                vxx1 = tmp_log_grads[j];
+
+                if(vxx1<xminval || vxx1>xmaxval) continue;
+
+                if(ppsubwin->axes.reverse[0] == TRUE)
+                  vxx1 = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],vxx1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&vxx1,&fy,&fz);
+
+                if (IsDownAxes(psubwin))
+                {
+                  vx[1]=vx[0]=xm;
+                  vy[0]=ym;
+                  vy[1]=vy[0]+iof/4;
+                }
+                else
+                {
+                  vx[0]=xm;vy[0]=ym;
+                  vx[1]= (integer) (vx[0]+barlengthx/2.0);
+                  vy[1]= (integer) (vy[0]+barlengthy/2.0);
+                }
+
+                if(ppsubwin->axes.axes_visible[0] == TRUE)
+                  C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              }
+              FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
+            } /* end NEW */
+            else
+            {
+              double xtmp2 = ppsubwin->axes.xgrads[i];
+              double dx = (ppsubwin->axes.xgrads[i+1] - ppsubwin->axes.xgrads[i]) / nbsubtics;
+
+              for (j=1;j<nbsubtics;j++)
+              {  
+                vxx1=xtmp2+dx*j;
+
+                if(vxx1<xminval || vxx1>xmaxval) continue;
+
+                if(ppsubwin->axes.reverse[0] == TRUE)
+                  vxx1 = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],vxx1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&vxx1,&fy,&fz);
+                /*               trans3d(psubwin,1,&xm,&ym,&vxx1,&fy,&fz); */
+
+
+                if (IsDownAxes(psubwin))
+                {
+                  vx[1]=vx[0]=xm;
+                  vy[0]=ym;
+                  vy[1]=vy[0]+iof/4;
+                }
+                else
+                {
+                  vx[0]=xm;vy[0]=ym;
+                  vx[1]= (integer) (vx[0]+barlengthx/2.0);
+                  vy[1]= (integer) (vy[0]+barlengthy/2.0);
+                }
+
+                if(ppsubwin->axes.axes_visible[0] == TRUE)
+                  C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              }
+            }
+          }
+          /***************************************************************/
+          /************************* COMMON PART *************************/
+          /***************************************************************/
+
+        }
+      }
+    }
+
+    if ( sciGetVisibility(ppsubwin->mon_x_label) )
+    { 
+
+      sciLabel * ppLabel = pLABEL_FEATURE(ppsubwin->mon_x_label) ;
+      if( ppLabel->auto_rotation )
+      {
+        sciSetFontOrientation(ppsubwin->mon_x_label, 0 ) ;
+      }
+
+
+      if( ppLabel->auto_position )
+      {
+
+        int segmentStart[2] = { ixbox[3], iybox[3] } ;
+        int segmentEnd[2]   = { ixbox[4], iybox[4] } ;
+
+        /* add the bar size and ticks label size to the offset */
+        int offset[2] = { constOffset[0] + maxTicksLabelSize[0] + abs( barlengthx ), 
+          constOffset[1] + maxTicksLabelSize[1] + abs( barlengthy )  } ;
+        computeLabelAutoPos( ppsubwin->mon_x_label, segmentStart, segmentEnd, offset ) ;
+      }
+      /* a trick to force the display with 2d scale */
+      drawTextEntity( ppLabel->text ) ;
+
+    }
+  }
+  else 
+  {
+    if  (pSUBWIN_FEATURE (psubwin)->project[1]==1) /* y is HERE */
+    {
+      double fx,fy,fz;
+      char c_format[5];
+
+      integer Ticsdir[2];
+      Ticsdir[0]=ixbox[4]-ixbox[5];
+      Ticsdir[1]=iybox[4]-iybox[5];
+      BBoxToval(&fx,&fy,&fz,xind[3],bbox);
+
+      x=inint((ixbox[3]+ixbox[4])/2.0 -rect[2] -iof);
+      y=inint((1/3.0)*iybox[3]+(2/3.0)*iybox[4]+ iof + 1.5*rect[3]);  
+
+      if(ppsubwin->axes.auto_ticks[1] == FALSE)
+      {
+        /* we display the y tics specified by the user*/
+        nbtics = ppsubwin->axes.u_nygrads;
+        nbsubtics = ppsubwin->axes.nbsubtics[1];
+
+        maxTicksLabelSize[0] = 0 ;
+        maxTicksLabelSize[1] = 0 ;
+
+        for(i=0;i<nbtics;i++)
+        {
+          char *foo = ppsubwin->axes.u_ylabels[i]; 
+          double ytmp = ppsubwin->axes.u_ygrads[i];
+
+          if(ytmp<yminval || ytmp>ymaxval) 
+          {
+            /*   sciprint("je rejete la valeur: %lf\n\n",xtmp); */
+            continue; /* cas ou TL est ON et on a des graduations qui ne seront pas affichees de tte facon */
+            /* donc autant ne pas aller plus loin dans l'algo... */
+          }
+
+          /***************************************************************/
+          /************************* COMMON PART *************************/
+          /***************************************************************/
+
+          if(ppsubwin->axes.reverse[1] == TRUE)
+            ytmp = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],ytmp);
+
+          ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&ytmp,&fz);
+          /*             trans3d(psubwin,1,&xm,&ym,&fx,&ytmp,&fz); */
+
+
+          vx[0]=xm;vy[0]=ym; 
+
+          barlengthx= (integer) (( Ticsdir[0])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
+          barlengthy= (integer) (( Ticsdir[1])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
+
+          C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); /* fix bug noticed by R.N. */
+
+          C2F(dr)("xstringl",foo,&x,&y,rect,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+          maxTicksLabelSize[0] = Max( maxTicksLabelSize[0], rect[2] ) ;
+          maxTicksLabelSize[1] = Max( maxTicksLabelSize[1], rect[3] ) ;
+
+          if (IsDownAxes(psubwin)){
+            vx[1]=vx[0];
+            vy[1]=vy[0]+iof/2;
+            posi[0] = inint(xm-rect[2]/2); 
+            posi[1]=inint( vy[0] + iof + rect[3]);}
+          else{
+            vx[1]=vx[0]+barlengthx;
+            vy[1]=vy[0]+barlengthy;
+            /*                     posi[0] = inint( xm+2*barlengthx-rect[2]/2);  */
+            posi[0] = inint( xm+2*barlengthx-rect[2]); 
+            posi[1]=inint( ym + 2*barlengthy + rect[3]);}
+
+
+          if(ppsubwin->axes.axes_visible[1] == TRUE){
+            C2F(dr)("xset","pattern",&textcolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            C2F(dr)("xstring",foo,&(posi[0]),&(posi[1]),PI0,&flag,PI0,PI0,&ang, PD0,PD0,PD0,0L,0L);
+            C2F(dr)("xset","pattern",&ticscolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);   
+            C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+          }
+          /* grid to put here */
+          if ( ppsubwin->grid[1] > -1 && ppsubwin->axes.axes_visible[1] )
+          {
+            gstyle = pSUBWIN_FEATURE (psubwin)->grid[1];
+
+            if((ppsubwin->logflags[1] =='l') && (i != nbtics-1))
+            {
+              double tmp[2];
+              double pas=0;
+              double * tmp_log_grads = (double *) NULL;
+
+
+              double * grads = ppsubwin->axes.u_ygrads;
+
+              tmp[0] = exp10(grads[i]);
+              tmp[1] = exp10(grads[i+1]);
+              pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
+
+              if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
+                sciprint("Error allocating tmp_log_grads\n");
+                return -1;
+              }
+
+              for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
+
+              for(j=0;j<nbsubtics;j++)
+              {
+                vyy1 = tmp_log_grads[j];
+
+                if(vyy1<=yminval || vyy1>=ymaxval) continue;
+
+                if(ppsubwin->axes.reverse[1] == TRUE)
+                  vyy1 = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],vyy1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&vyy1,&fz);
+
+                /*   if ((xm != ixbox[3]) && (xm != ixbox[4])) */
+                /*                             { */ 
+                xg[0]= xm;  yg[0]= ym;  
+                if (Ishidden(psubwin))
+                { xg[1]= xm; yg[1]= iybox[0] -iybox[5]+ym; }
+                else
+                {xg[1]= ixbox[1] - ixbox[3] +xm; yg[1]= iybox[5] - iybox[4] +ym; } 
+                C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                xg[0]= xg[1]; yg[0]= yg[1];
+                xg[1] = ixbox[1] - ixbox[3] +xm; yg[1]=  iybox[0] - iybox[4] +ym;
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
+                /*     } */
+              }
+              FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
+            }
+            else
+            {
+              if(ytmp>yminval && ytmp<ymaxval) 
+              {
+                xg[0]= xm;  yg[0]= ym;  
+                if (Ishidden(psubwin))
+                { xg[1]= xm; yg[1]= iybox[0] -iybox[5]+ym; }
+                else
+                {xg[1]= ixbox[1] - ixbox[3] +xm; yg[1]= iybox[5] - iybox[4] +ym; } 
+                C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                xg[0]= xg[1]; yg[0]= yg[1];
+                xg[1] = ixbox[1] - ixbox[3] +xm; yg[1]=  iybox[0] - iybox[4] +ym;
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
+              }
+            }
+          }
+
+          /* and subtics */
+          if(i != nbtics-1)
+          {
+            if(ppsubwin->logflags[1] =='l')
+            {
+              double tmp[2];
+              double pas=0;
+              double * tmp_log_grads = (double *) NULL;
+
+
+              double * grads = ppsubwin->axes.u_ygrads;
+
+              tmp[0] = exp10(grads[i]);
+              tmp[1] = exp10(grads[i+1]);
+              pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
+
+              if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
+                sciprint("Error allocating tmp_log_grads\n");
+                return -1;
+              }
+
+              for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
+
+              for(j=0;j<nbsubtics;j++)
+              {
+                vyy1 = tmp_log_grads[j];
+
+                if(vyy1<yminval || vyy1>ymaxval) continue;
+
+                if(ppsubwin->axes.reverse[1] == TRUE)
+                  vyy1 = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],vyy1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&vyy1,&fz);
+
+                if (IsDownAxes(psubwin))
+                {
+                  vx[1]=vx[0]=xm;
+                  vy[0]=ym;
+                  vy[1]=vy[0]+iof/4;
+                }
+                else
+                {
+                  vx[0]=xm;vy[0]=ym;
+                  vx[1]= (integer) (vx[0]+barlengthx/2.0);
+                  vy[1]= (integer) (vy[0]+barlengthy/2.0);
+                }
+
+                if(ppsubwin->axes.axes_visible[1] == TRUE)
+                  C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              }
+              FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
+
+            } /* end NEW */
+            else
+            {
+
+              double ytmp2 = ppsubwin->axes.u_ygrads[i];
+              double dy = (ppsubwin->axes.u_ygrads[i+1] - ppsubwin->axes.u_ygrads[i]) / nbsubtics;
+              for(j=0;j<nbsubtics;j++)
+              {
+                vyy1=ytmp2+dy*j;
+
+                if(vyy1<yminval || vyy1>ymaxval) continue;
+
+                if(ppsubwin->axes.reverse[1] == TRUE)
+                  vyy1 = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],vyy1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&vyy1,&fz);
+                /*               trans3d(psubwin,1,&xm,&ym,&fx,&vyy1,&fz); */
+
+
+                if (IsDownAxes(psubwin))
+                {
+                  vx[1]=vx[0]=xm;
+                  vy[0]=ym;
+                  vy[1]=vy[0]+iof/4;
+                }
+                else
+                {
+                  vx[0]=xm;vy[0]=ym;
+                  vx[1]= (integer) (vx[0]+barlengthx/2.0);
+                  vy[1]= (integer) (vy[0]+barlengthy/2.0);
+                }
+
+                if(ppsubwin->axes.axes_visible[1] == TRUE)
+                  C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              }
+            }
+          }
+          /***************************************************************/
+          /************************* COMMON PART *************************/
+          /***************************************************************/
+
+        }
+      }
+      else /* we display the computed tics */
+      {
+        AdaptGraduationsOnYBottomLeft(iof,x,y,size,Ticsdir,fontid,psubwin,yminval,ymaxval,fx,0.,fz);
+
+        lastyindex = ppsubwin->axes.nygrads - 1;
+
+        if(lastyindex == 0)
+          ChooseFormatForOneGrad(c_format,&(ppsubwin->axes.ygrads[0]));
+        else
+          ChoixFormatE(c_format,
+          ppsubwin->axes.ygrads[0],
+          ppsubwin->axes.ygrads[lastyindex],
+          ((ppsubwin->axes.ygrads[lastyindex])-(ppsubwin->axes.ygrads[0]))/(lastyindex));
+
+        nbtics = ppsubwin->axes.nygrads;
+        nbsubtics = ppsubwin->axes.nbsubtics[1];
+
+        maxTicksLabelSize[0] = 0 ;
+        maxTicksLabelSize[1] = 0 ;
+
+        for(i=0;i<nbtics;i++)
+        {
+          char foo[256]; 
+          double ytmp = ppsubwin->axes.ygrads[i];
+
+          if(ytmp<yminval || ytmp>ymaxval) 
+          {
+            /*   sciprint("je rejete la valeur: %lf\n\n",xtmp); */
+            continue; /* cas ou TL est ON et on a des graduations qui ne seront pas affichees de tte facon */
+            /* donc autant ne pas aller plus loin dans l'algo... */
+          }
+
+          sprintf(foo,c_format,ytmp);
+
+          /***************************************************************/
+          /************************* COMMON PART *************************/
+          /***************************************************************/
+
+          if(ppsubwin->axes.reverse[1] == TRUE)
+            ytmp = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],ytmp);
+
+          ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&ytmp,&fz);
+          /*             trans3d(psubwin,1,&xm,&ym,&fx,&ytmp,&fz); */
+
+
+          vx[0]=xm;vy[0]=ym; 
+
+          barlengthx= (integer) (( Ticsdir[0])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
+          barlengthy= (integer) (( Ticsdir[1])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
+
+          C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); /* fix bug noticed by R.N. */
+
+          C2F(dr)("xstringl",foo,&x,&y,rect,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+          maxTicksLabelSize[0] = Max( maxTicksLabelSize[0], rect[2] ) ;
+          maxTicksLabelSize[1] = Max( maxTicksLabelSize[1], rect[3] ) ;
+
+          if (IsDownAxes(psubwin)){
+            vx[1]=vx[0];
+            vy[1]=vy[0]+iof/2;
+            posi[0] = inint(xm-rect[2]/2); 
+            posi[1]=inint( vy[0] + iof + rect[3]);}
+          else{
+            vx[1]=vx[0]+barlengthx;
+            vy[1]=vy[0]+barlengthy;
+            /*                     posi[0] = inint( xm+2*barlengthx-rect[2]/2);  */
+            posi[0] = inint( xm+2*barlengthx-rect[2]); 
+            posi[1]=inint( ym + 2*barlengthy + rect[3]);}
+
+          if(ppsubwin->axes.axes_visible[1] == TRUE){
+            C2F(dr)("xset","pattern",&textcolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            if ( ppsubwin->logflags[1] == 'l' )
+            {
+              int smallersize = fontid[1]-2;
+              int old_rect10[4];
+              /*                   char str[2] = "xv"; */
+              int posi10[2];
+
+              posi10[0] = posi[0] - logrect[2];
+              posi10[1] = posi[1] + logrect[3];
+
+              C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              C2F(dr)("xstring","10",(&posi10[0]),(&posi10[1]),PI0,&flag,PI0,PI0,&angle,PD0,PD0,PD0,0L,0L);
+
+              C2F(dr)("xstringl","10",(&posi10[0]),(&posi10[1]),old_rect10,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+
+              posi[0] = old_rect10[0] + old_rect10[2];
+              posi[1] = (int) (old_rect10[1] - old_rect10[3]*.1);
+
+              C2F(dr)("xset","font",fontid,&smallersize,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              C2F(dr)("xstring",foo,&(posi[0]),&(posi[1]),PI0,&flag,PI0,PI0,&ang, PD0,PD0,PD0,0L,0L);
+
+              /* put back the current fontid */
+              C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+            }
+            else
+              C2F(dr)("xstring",foo,&(posi[0]),&(posi[1]),PI0,&flag,PI0,PI0,&ang, PD0,PD0,PD0,0L,0L);
+
+            C2F(dr)("xset","pattern",&ticscolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);   
+            C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+          }
+          /* grid to put here */
+          if ( ppsubwin->grid[1] > -1 && ppsubwin->axes.axes_visible[1] )
+          {
+            gstyle = pSUBWIN_FEATURE (psubwin)->grid[1];
+
+            if((ppsubwin->logflags[1] =='l') && (i != nbtics-1))
+            {
+              double tmp[2];
+              double pas=0;
+              double * tmp_log_grads = (double *) NULL;
+
+
+              double * grads = ppsubwin->axes.ygrads;
+
+              tmp[0] = exp10(grads[i]);
+              tmp[1] = exp10(grads[i+1]);
+              pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
+
+              if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
+                sciprint("Error allocating tmp_log_grads\n");
+                return -1;
+              }
+
+              for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
+
+              for(j=0;j<nbsubtics;j++)
+              {
+                vyy1 = tmp_log_grads[j];
+
+                if(vyy1<=yminval || vyy1>=ymaxval) continue;
+
+                if(ppsubwin->axes.reverse[1] == TRUE)
+                  vyy1 = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],vyy1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&vyy1,&fz);
+
+                /*    if ((xm != ixbox[3]) && (xm != ixbox[4])) */
+                /*                             {  */
+                xg[0]= xm;  yg[0]= ym;  
+                if (Ishidden(psubwin))
+                { xg[1]= xm; yg[1]= iybox[0] -iybox[5]+ym; }
+                else
+                {xg[1]= ixbox[1] - ixbox[3] +xm; yg[1]= iybox[5] - iybox[4] +ym; } 
+                C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                xg[0]= xg[1]; yg[0]= yg[1];
+                xg[1] = ixbox[1] - ixbox[3] +xm; yg[1]=  iybox[0] - iybox[4] +ym;
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
+                /*     } */
+              }
+              FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
+            }
+            else
+            {
+              if(ytmp>yminval && ytmp<ymaxval) 
+              {
+                xg[0]= xm;  yg[0]= ym;  
+                if (Ishidden(psubwin))
+                { xg[1]= xm; yg[1]= iybox[0] -iybox[5]+ym; }
+                else
+                {xg[1]= ixbox[1] - ixbox[3] +xm; yg[1]= iybox[5] - iybox[4] +ym; } 
+                C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                xg[0]= xg[1]; yg[0]= yg[1];
+                xg[1] = ixbox[1] - ixbox[3] +xm; yg[1]=  iybox[0] - iybox[4] +ym;
+                C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+                C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
+              }
+            }
+          }
+
+          /* and subtics */
+          if(i != nbtics-1)
+          {
+            if(ppsubwin->logflags[1] =='l')
+            {
+              double tmp[2];
+              double pas=0;
+              double * tmp_log_grads = (double *) NULL;
+
+
+              double * grads = ppsubwin->axes.ygrads;
+
+              tmp[0] = exp10(grads[i]);
+              tmp[1] = exp10(grads[i+1]);
+              pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
+
+              if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
+                sciprint("Error allocating tmp_log_grads\n");
+                return -1;
+              }
+
+              for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
+
+              for(j=0;j<nbsubtics;j++)
+              {
+                vyy1 = tmp_log_grads[j];
+
+                if(vyy1<yminval || vyy1>ymaxval) continue;
+
+                if(ppsubwin->axes.reverse[1] == TRUE)
+                  vyy1 = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],vyy1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&vyy1,&fz);
+
+                if (IsDownAxes(psubwin))
+                {
+                  vx[1]=vx[0]=xm;
+                  vy[0]=ym;
+                  vy[1]=vy[0]+iof/4;
+                }
+                else
+                {
+                  vx[0]=xm;vy[0]=ym;
+                  vx[1]= (integer) (vx[0]+barlengthx/2.0);
+                  vy[1]= (integer) (vy[0]+barlengthy/2.0);
+                }
+
+                if(ppsubwin->axes.axes_visible[1] == TRUE)
+                  C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              }
+              FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
+
+            } /* end NEW */
+            else
+            {
+
+              double ytmp2 = ppsubwin->axes.ygrads[i];
+              double dy = (ppsubwin->axes.ygrads[i+1] - ppsubwin->axes.ygrads[i]) / nbsubtics;
+              for(j=0;j<nbsubtics;j++)
+              {
+                vyy1=ytmp2+dy*j;
+
+                if(vyy1<yminval || vyy1>ymaxval) continue;
+
+                if(ppsubwin->axes.reverse[1] == TRUE)
+                  vyy1 = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],vyy1);
+
+                ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&vyy1,&fz);
+
+                if (IsDownAxes(psubwin))
+                {
+                  vx[1]=vx[0]=xm;
+                  vy[0]=ym;
+                  vy[1]=vy[0]+iof/4;
+                }
+                else
+                {
+                  vx[0]=xm;vy[0]=ym;
+                  vx[1]= (integer) (vx[0]+barlengthx/2.0);
+                  vy[1]= (integer) (vy[0]+barlengthy/2.0);
+                }
+
+                if(ppsubwin->axes.axes_visible[1] == TRUE)
+                  C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
+              }
+            }
+          }
+
+          /***************************************************************/
+          /************************* COMMON PART *************************/
+          /***************************************************************/
+        }
+      }
+    }
+
+    if ( sciGetVisibility(ppsubwin->mon_y_label) )
+    {  
+      sciLabel * ppLabel =  pLABEL_FEATURE(ppsubwin->mon_y_label) ;
+      if( ppLabel->auto_rotation )
+      {
+        sciSetFontOrientation(ppsubwin->mon_y_label, 0 ) ;
+      }
+
+      if( ppLabel->auto_position )
+      {
+
+        int segmentStart[2] = { ixbox[3], iybox[3] } ;
+        int segmentEnd[2]   = { ixbox[4], iybox[4] } ;
+
+        /* add the bar size and ticks label size to the offset */
+        int offset[2] = { constOffset[0] + maxTicksLabelSize[0] + abs( barlengthx ), 
+          constOffset[1] + maxTicksLabelSize[1] + abs( barlengthy )  } ;
+        computeLabelAutoPos( ppsubwin->mon_y_label, segmentStart, segmentEnd, offset ) ;
+      }
+      /* a trick to force the display with 2d scale */
+      drawTextEntity( ppLabel->text ) ;
+
+    }
+  }
+  /* reset font to its current size & to current color*/ 
+  if ( fontsize != -1 ){
+    fontid[1] = fontsize_kp;
+    C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+  }
+  if ( textcolor != -1 || ticscolor != -1 ) 
+    C2F(dr)("xset","pattern",&color_kp,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+  /***/
+  /* FREE(loc); */
+
+
+  return 0;
+}
+/*-----------------------------------------------------------------------------------------*/
index aaebafa..bed68ef 100644 (file)
@@ -24,7 +24,6 @@
 #include <windows.h>
 #endif
 
-#include "Graphics.h" 
 #include "BuildObjects.h"
 #include "GetProperty.h"
 #include "InitObjects.h"
@@ -35,6 +34,7 @@
 #include "CloneObjects.h"
 #include "StringMatrix.h"
 #include "Xcall1.h"
+#include "sciprint.h"
 
 #include "MALLOC.h" /* MALLOC */
 
index c6b3142..02fef1f 100644 (file)
@@ -8,7 +8,6 @@
 #include <stdio.h>
 #include <string.h>
 #include "math_graphics.h"
-#include "Graphics.h" 
 #include "PloEch.h"
 
 #include "GetProperty.h"
@@ -18,6 +17,8 @@
 #include "Axes.h"
 #include "Xcall1.h"
 #include "Champ.h"
+#include "sciprint.h"
+#include "periScreen.h"
 
 
 #include "MALLOC.h" /* MALLOC */
index 3082133..43db124 100644 (file)
 #include <stdarg.h>
 #include <time.h>
 
-#include "Graphics.h" 
 #include "CloneObjects.h"
 #include "GetProperty.h"
 #include "BuildObjects.h"
 #include "bcg.h"
 #include "SetProperty.h"
+#include "sciprint.h"
 
 
 #include "MALLOC.h" /* MALLOC */
index 11692ee..e4aa2e5 100644 (file)
@@ -8,20 +8,15 @@
 #include <stdio.h>
 #include <math.h>
 #include "math_graphics.h"
-#include "Graphics.h" 
 #include "PloEch.h"
 #include "Xcall1.h"
 #include "sciprint.h"
 #include "MALLOC.h"
+#include "Format.h"
+#include "Contour.h"
 
 #include "GetProperty.h"
 
-/* #include "Entities.h" /\* F.Leray 21.04.04 : for update_2dbounds call*\/ */
-/*extern void compute_data_bounds(int cflag,char dataflag,double *x,double *y,int n1,int n2,double *drect);*/
-extern void compute_data_bounds2(int cflag,char dataflag,char *logflags,double *x,double *y,int n1,int n2,double *drect);
-extern BOOL update_specification_bounds(sciPointObj *psubwin, double *rect,int flag);
-extern int re_index_brect(double * brect, double * drect);
-extern BOOL strflag2axes_properties(sciPointObj * psubwin, char * strflag);
 
 #ifdef _MSC_VER
 extern void Scistring (char *str);
@@ -32,11 +27,7 @@ typedef void (level_f) __PARAMS((integer ival, double Cont, double xncont,
 typedef void (*ptr_level_f) __PARAMS((integer ival, double Cont, double xncont,
                               double yncont));
 
-static int 
-Contour2D __PARAMS((ptr_level_f,char *,double *x,double *y,double *z,integer *n1,
-                  integer *n2,integer *flagnz,integer *nz,double *zz,
-                  integer *style,char *strflag,char *legend,double *brect,
-                  integer *aaint,integer lstr1,integer lstr2));
+
 static void 
 contourI __PARAMS((ptr_level_f,double *, double *, double *,
                  double *, integer *, integer *, integer *));
@@ -147,177 +138,157 @@ static double x_cont(integer i) { return GX[i] ;}
 
 static double y_cont(integer i) { return GY[i] ;}
 
-/*------------------------------------------------------------
- * Draw level curves for a function f(x,y) which values 
- * at points x(i),y(j) are given by z(i,j)
- * - z is a (n1,n2) matrix 
- * - x is a (1,n1) matrix 
- * - y is a (1,n2) matrix 
- * - x,y,z are stored as one dimensionnal array in C 
- * - if *flagnz =0 
- * -   then  nz is an integer pointer to the number of level curves. 
- *     else  zz is an array which gives th requested level values.
- *            (and nz is the size of thos array)
- * Computed from min and max of z
- * Exemple Contour(1:5,1:10,rand(5,10),5);
- *---------------------------------------------------------------*/
+
 
 static double ZC=0.0;
 static char   ContNumFormat[100];
 
-/** interface for contour2d **/
-
-int C2F(contour2)(double *x, double *y, double *z, integer *n1, integer *n2, integer *flagnz, integer *nz, double *zz, integer *style, char *strflag, char *legend, double *brect, integer *aaint, integer lstr1, integer lstr2)
-{
-  Contour2D(ContStore2,"contour2",x,y,z,n1,n2,flagnz,nz,zz,style,strflag,
-           legend,brect,aaint,lstr1,lstr2);
-  return 0;
-}
-
-/* interface for contour2di used in macro contourf 
- * used when we want to get the values which constitues the contour inside Scilab 
- * contour2di + c2dex 
- * THIS PROCEDURE IS NO LONGUER USED 
- */
+/*--------------------------------------------------------------------
+*  the level curve is crossing the segment (i,j) (ib,jb)
+*  look store the level curve point and try to find the next segment to look at
+*  Cont: value of f along the contour 
+*  ncont: number of contour 
+*  c: indice of the contour Cont 
+*---------------------------------------------------------------------*/
 
-static int Contour2D(ptr_level_f func, char *name, double *x, double *y, double *z, integer *n1, integer *n2, integer *flagnz, integer *nz, double *zz, integer *style, char *strflag, char *legend, double *brect, integer *aaint, integer lstr1, integer lstr2)
+static void look(ptr_level_f func, integer i, integer j, integer ib, integer jb, integer qq, double Cont, integer style)
 {
-  integer err=0;
-  static double *zconst;
-  double zmin,zmax;
-  integer N[3],i;
-  double drect[6];
-  sciPointObj * psubwin = NULL;  /* Adding F.Leray 22.04.04 */
-  BOOL bounds_changed = FALSE;
-  BOOL axes_properties_changed = FALSE;
-  
-  /** Boundaries of the frame **/
-  psubwin = sciGetSelectedSubWin (sciGetCurrentFigure ());
-
-  /* Force psubwin->is3d to FALSE: we are in 2D mode */
-  if (sciGetSurface(psubwin) == (sciPointObj *) NULL)
-  {
-    pSUBWIN_FEATURE (psubwin)->is3d = FALSE;
-    pSUBWIN_FEATURE (psubwin)->project[2]= 0;
-  }
-  else
+  integer ip,jp,im,jm,zds,ent=0,flag=0,wflag;
+  jp= j+1; ip= i+1; jm=j-1;im=i-1;
+  /*  on regarde comment est le segment de depart */
+  if  ( jb == jm)  flag = 1; 
+  else  { 
+    if ( ib == im ) flag = 2 ;
+    else  {
+      if ( jb == jp ) flag = 3 ;
+      else  if ( ib == ip ) flag = 4;}}
+  switch  (  flag)
   {
-    pSUBWIN_FEATURE (psubwin)->theta_kp=pSUBWIN_FEATURE (psubwin)->theta;
-    pSUBWIN_FEATURE (psubwin)->alpha_kp=pSUBWIN_FEATURE (psubwin)->alpha;  
+  case  1 :
+    if  (get_itg_cont(i,jm) > 1) return;
+    ent=1 ; /* le segment est vertical vers le bas */
+    /* Storing intersection point */
+    (*func)(0,Cont, x_cont(i), 
+      f_intercept(Cont,phi_cont(i,jm),
+      y_cont(jm),phi_cont(i,j),y_cont(j)));
+    break;
+  case 2 : 
+    if  (get_itg_cont(im,j) == 1 || get_itg_cont(im,j)==3 ) return;
+    ent=2 ; /* le segment est horizontal gauche */
+    /* Storing intersection point */
+    (*func)( 0,Cont,
+      f_intercept(Cont,phi_cont(im,j),
+      x_cont(im),phi_cont(i,j),x_cont(i)), y_cont(j));
+    break ; 
+  case 3 :
+    if  (get_itg_cont(i,j) > 1 ) return;
+    ent=3 ; /* le segment est vertical haut */
+    /* Storing intersection point */
+    (*func)(0,Cont,x_cont(i), f_intercept(Cont,phi_cont(i,j),
+      y_cont(j),phi_cont(i,jp),y_cont(jp)));
+    break ;
+  case 4 :
+    if  (get_itg_cont(i,j) == 1 || get_itg_cont(i,j)==3 ) return;
+    ent=4 ; /* le segment est horizontal droit */
+    /* Storing intersection point */
+    (*func)(0,Cont,f_intercept(Cont,phi_cont(i,j),
+      x_cont(i),phi_cont(ip,j),x_cont(ip)),
+      y_cont(j));
+    break;
+  default :
+    sciprint(" Error in case wrong value ");
+    break;
   }
-
-  pSUBWIN_FEATURE (psubwin)->alpha  = 0.0;
-  pSUBWIN_FEATURE (psubwin)->theta  = 270.0;
-
-  /*****TO CHANGE F.Leray 10.09.04    for (i=0;i<4;i++) pSUBWIN_FEATURE(psubwin)->axes.aaint[i] = aaint[i]; */
-  if (sciGetGraphicMode (psubwin)->autoscaling) {
-    /* compute and merge new specified bounds with psubwin->Srect */
-    switch (strflag[1])  {
-        case '0': 
-          /* do not change psubwin->Srect */
-          break;
-        case '1' : case '3' : case '5' : case '7':
-          /* Force psubwin->Srect=brect */
-          re_index_brect(brect,drect);
-          break;
-        case '2' : case '4' : case '6' : case '8':
-          /* Force psubwin->Srect to the x and y bounds */
-          /*  compute_data_bounds(1,'g',x,y,*n1,*n2,drect); */
-          compute_data_bounds2(1,'g',pSUBWIN_FEATURE(psubwin)->logflags,x,y,*n1,*n2,drect);
-          break;
-    }
-    if (!pSUBWIN_FEATURE(psubwin)->FirstPlot &&(strflag[1] == '7' || strflag[1] == '8')) { /* merge psubwin->Srect and drect */
-      drect[0] = Min(pSUBWIN_FEATURE(psubwin)->SRect[0],drect[0]); /*xmin*/
-      drect[2] = Min(pSUBWIN_FEATURE(psubwin)->SRect[2],drect[2]); /*ymin*/
-      drect[1] = Max(pSUBWIN_FEATURE(psubwin)->SRect[1],drect[1]); /*xmax*/
-      drect[3] = Max(pSUBWIN_FEATURE(psubwin)->SRect[3],drect[3]); /*ymax*/
-    }
-    if (strflag[1] != '0')
-      bounds_changed = update_specification_bounds(psubwin, drect,2);
-  } 
-
-  if(pSUBWIN_FEATURE (psubwin)->FirstPlot == TRUE) bounds_changed = TRUE;
-
-  axes_properties_changed = strflag2axes_properties(psubwin, strflag);
-
-  pSUBWIN_FEATURE (psubwin)->FirstPlot = FALSE; /* just after strflag2axes_properties */
-
-  zmin=(double) Mini(z,*n1*(*n2)); 
-  zmax=(double) Maxi(z,*n1*(*n2));
-
-  /** Scales **/
-  if (strcmp(name,"contour2")==0 )
-    {
-      axis_draw(strflag);
-      frame_clip_on();
-    }
-  if (*flagnz==0)
+  wflag=1;
+  while ( wflag) 
+  { 
+    jp= j+1; ip= i+1; jm=j-1;im=i-1;
+    switch  ( ent) 
+    {case 1 :
+    inc_itg_cont(i,jm,2L);
+    ent = ffnd(func,i,ip,ip,i,j,j,jm,jm,ent,qq,Cont,&zds);
+    /* on calcule le nouveau point, ent donne la 
+    direction du segment a explorer */
+    switch ( ent)
     {
-      if (( zconst = MALLOC( (*nz) * sizeof(double) ) )== 0) 
-       {
-         sciprint("Running out of memory\r\n");
-         return 0;
-       }
-      for ( i =0 ; i < *nz ; i++) 
-       zconst[i]=zmin + (i+1)*(zmax-zmin)/(*nz+1);
-      N[0]= *n1;N[1]= *n2;N[2]= *nz;
-      contourI(func,x,y,z,zconst,N,style,&err);
-      FREE(zconst) ;
-      zconst = NULL ;
+    case -1: wflag=0; break;
+    case 1 : i=ip ; break ;
+    case 2 : i=ip;j=jm; break ;
     }
-  else
-    {
-      N[0]= *n1;N[1]= *n2;N[2]= *nz;
-      contourI(func,x,y,z,zz,N,style,&err);
+    break ;
+    case 2  :
+      inc_itg_cont(im,j,1L);
+      ent = ffnd(func,i,i,im,im,j,jm,jm,j,ent,qq,Cont,&zds);
+      switch ( ent)
+      { 
+      case -1: wflag=0; break;
+      case 2 : j = jm ;break ;
+      case  3  : i=im;j=jm; break ;
+      }
+      break ;
+    case 3 :
+      inc_itg_cont(i,j,2L);
+      ent = ffnd(func,i,im,im,i,j,j,jp,jp,ent,qq,Cont,&zds);
+      switch ( ent)
+      { 
+      case -1: wflag=0; break;
+      case 3 : i=im; break ;
+      case 4 : i=im;j=jp; break ;
+      }
+      break ;
+    case 4 :
+      inc_itg_cont(i,j,1L);
+      ent = ffnd(func,i,i,ip,ip,j,jp,jp,j,ent,qq,Cont,&zds);
+      switch ( ent)
+      {
+      case -1: wflag=0; break;
+      case 4 :j=jp;break ;
+      case 1 :i=ip;j=jp;break ;
+      }
+      break ;
     }
 
-  if (strcmp(name,"contour2")==0 )frame_clip_off();
-
-  return(0);
-}
-
-int C2F(contourif)(double *x, double *y, double *z, integer *n1, integer *n2, integer *flagnz, integer *nz, double *zz, integer *style)
-{
-  integer err=0;
-  static double *zconst;
-  double zmin,zmax;
-  integer N[3],i;
-
-  zmin=(double) Mini(z,*n1*(*n2)); 
-  zmax=(double) Maxi(z,*n1*(*n2));
-
-  if (*flagnz==0)
+    /** new segment is on the boundary **/
+    if ( zds == 1) 
     {
-      if ( ( zconst = MALLOC( (*nz) * sizeof(double) ) ) == 0 ) 
-       {
-         sciprint("Running out of memory\r\n");
-         return 0;
-       }
-      for ( i =0 ; i < *nz ; i++) 
-       zconst[i]=zmin + (i+1)*(zmax-zmin)/(*nz+1);
-      N[0]= *n1;N[1]= *n2;N[2]= *nz;
-      contourI(GContStore2,x,y,z,zconst,N,style,&err);
-      FREE(zconst) ;
-      zconst = NULL ;
+      switch ( ent) 
+      {
+      case 1 : inc_itg_cont(i,(j-1),2L); break ; 
+      case 2 : inc_itg_cont(i-1,j,1L);  break ; 
+      case 3 : inc_itg_cont(i,j,2L); break ; 
+      case 4 : inc_itg_cont(i,j,1L); break ; 
+      }
+      /** we must quit the while loop **/
+      wflag = 0 ;
     }
-  else
+    /**  init point was inside the domain */
+    if ( qq == 2) 
     {
-      N[0]= *n1;N[1]= *n2;N[2]= *nz;
-      contourI(GContStore2,x,y,z,zz,N,style,&err);
+      switch ( ent) 
+      {
+      case 1 : if  ( get_itg_cont (i,j-1)  > 1) wflag = 0 ; break ; 
+      case 2 : if  ( oddp(get_itg_cont(i-1,j))) wflag = 0 ; break ; 
+      case 3 : if  ( get_itg_cont(i,j) > 1)     wflag = 0 ; break ; 
+      case 4 : if  ( oddp(get_itg_cont(i,j)))   wflag = 0 ; break ; 
+      }
     }
-
-  return(0);
+  }
+  if ( func == GContStore2 ) 
+    GContStore2Last();
+  else 
+    ContourTrace(Cont,style);
 }
 
+
 /*-------------------------------------------------------
- *  The function f is given on a grid and we want the level curves 
- *  for the zCont[N[2]] values 
- *  x : of size N[0] gives the x-values of the grid 
- *  y : of size N[1] gives the y-values of the grid 
- *  z : of size N[0]*N[1]  gives the f-values on the grid 
- *  style: size ncont (=N[2]) or empty integer pointer 
- *  gives the dash style for contour i
- *-------------------------------------------------------*/
+*  The function f is given on a grid and we want the level curves 
+*  for the zCont[N[2]] values 
+*  x : of size N[0] gives the x-values of the grid 
+*  y : of size N[1] gives the y-values of the grid 
+*  z : of size N[0]*N[1]  gives the f-values on the grid 
+*  style: size ncont (=N[2]) or empty integer pointer 
+*  gives the dash style for contour i
+*-------------------------------------------------------*/
 
 static void contourI(ptr_level_f func, double *x, double *y, double *z, double *zCont, integer *N, integer *style, integer *err)
 {
@@ -340,200 +311,100 @@ static void contourI(ptr_level_f func, double *x, double *y, double *z, double *
   if ( (ybd_cont == NULL) && n5 != 0) check= 0;
   if ( (itg_cont == NULL) && n1*n2 != 0) check= 0;
   if ( check == 0) 
-    {
-      FREE( xbd_cont ) ;
-      FREE( ybd_cont ) ;
-      FREE( itg_cont ) ;
-      sciprint("contourI_: Running out of memory\n");
-      return;
-    }
+  {
+    FREE( xbd_cont ) ;
+    FREE( ybd_cont ) ;
+    FREE( itg_cont ) ;
+    sciprint("contourI_: Running out of memory\n");
+    return;
+  }
   /* just a parametrization of the boundary points */
   for ( i = 0 ; i <  n2 ; i++)
-       {
-         ybd_cont[i] = i ;
-         xbd_cont[i] = 0 ;
-       }
+  {
+    ybd_cont[i] = i ;
+    xbd_cont[i] = 0 ;
+  }
   for ( i = 1 ; i <  n1 ; i++)
-       {
-         ybd_cont[n2+i-1] = n2-1 ;
-         xbd_cont[n2+i-1] = i  ;
-       }
+  {
+    ybd_cont[n2+i-1] = n2-1 ;
+    xbd_cont[n2+i-1] = i  ;
+  }
   for ( i = n2-2;  i >= 0  ; i--)
-       {
-         ybd_cont[2*n2 +n1-3-i] = i ;
-         xbd_cont[2*n2 +n1-3-i] = n1-1  ;
-       }
+  {
+    ybd_cont[2*n2 +n1-3-i] = i ;
+    xbd_cont[2*n2 +n1-3-i] = n1-1  ;
+  }
   for ( i = n1-2 ; i >= 0 ; i--)
-       {
-         ybd_cont[2*n2 +2*n1-4-i] = 0 ;
-         xbd_cont[2*n2 +2*n1-4-i] = i  ;
-       }
+  {
+    ybd_cont[2*n2 +2*n1-4-i] = 0 ;
+    xbd_cont[2*n2 +2*n1-4-i] = i  ;
+  }
   for ( c= 0 ; c < ncont ; c++)
-    {
-      stylec = ( style != (integer *) 0) ? style[c] : c;
-      /** itg-cont is a flag array to memorize checked parts of the grid **/
-      for ( i = 0 ; i < n1; i++)
-       for ( j =0 ; j < n2 ; j++)
-         itg_cont[i+n1*j]=0 ;
-      /** all the boundary segments **/
-      for ( k = 1 ; k < n5 ; k++)
-       { integer ib,jb;
-       i = xbd_cont[k] ; j = ybd_cont[k];
-       ib = xbd_cont[k-1] ; jb= ybd_cont[k-1];
-       if  (not_same_sign (phi_cont(i,j)-zCont[c] , 
-                           phi_cont(ib,jb)-zCont[c]))
-         look(func,i,j,ib,jb,1L,zCont[c],stylec);
-       }
-      /** inside segments **/
-      for ( i = 1 ; i < n1-1; i++)
-       for ( j = 1 ; j < n2-1 ; j++)
-         if  (not_same_sign ( phi_cont(i,j)-zCont[c] , 
-                              phi_cont(i, j-1)-zCont[c]))
-           look(func,i,j,i,j-1,2L,zCont[c],stylec);
+  {
+    stylec = ( style != (integer *) 0) ? style[c] : c;
+    /** itg-cont is a flag array to memorize checked parts of the grid **/
+    for ( i = 0 ; i < n1; i++)
+      for ( j =0 ; j < n2 ; j++)
+        itg_cont[i+n1*j]=0 ;
+    /** all the boundary segments **/
+    for ( k = 1 ; k < n5 ; k++)
+    { integer ib,jb;
+    i = xbd_cont[k] ; j = ybd_cont[k];
+    ib = xbd_cont[k-1] ; jb= ybd_cont[k-1];
+    if  (not_same_sign (phi_cont(i,j)-zCont[c] , 
+      phi_cont(ib,jb)-zCont[c]))
+      look(func,i,j,ib,jb,1L,zCont[c],stylec);
     }
+    /** inside segments **/
+    for ( i = 1 ; i < n1-1; i++)
+      for ( j = 1 ; j < n2-1 ; j++)
+        if  (not_same_sign ( phi_cont(i,j)-zCont[c] , 
+          phi_cont(i, j-1)-zCont[c]))
+          look(func,i,j,i,j-1,2L,zCont[c],stylec);
+  }
   FREE( xbd_cont ) ;
   FREE( ybd_cont ) ;
   FREE( itg_cont ) ;
 
 }
 
-/*--------------------------------------------------------------------
- *  the level curve is crossing the segment (i,j) (ib,jb)
- *  look store the level curve point and try to find the next segment to look at
- *  Cont: value of f along the contour 
- *  ncont: number of contour 
- *  c: indice of the contour Cont 
- *---------------------------------------------------------------------*/
-
-static void look(ptr_level_f func, integer i, integer j, integer ib, integer jb, integer qq, double Cont, integer style)
+int C2F(contourif)(double *x, double *y, double *z, integer *n1, integer *n2, integer *flagnz, integer *nz, double *zz, integer *style)
 {
-  integer ip,jp,im,jm,zds,ent=0,flag=0,wflag;
-  jp= j+1; ip= i+1; jm=j-1;im=i-1;
-  /*  on regarde comment est le segment de depart */
-  if  ( jb == jm)  flag = 1; 
-  else  { 
-    if ( ib == im ) flag = 2 ;
-    else  {
-      if ( jb == jp ) flag = 3 ;
-      else  if ( ib == ip ) flag = 4;}}
-  switch  (  flag)
+  integer err=0;
+  static double *zconst;
+  double zmin,zmax;
+  integer N[3],i;
+
+  zmin=(double) Mini(z,*n1*(*n2)); 
+  zmax=(double) Maxi(z,*n1*(*n2));
+
+  if (*flagnz==0)
     {
-    case  1 :
-      if  (get_itg_cont(i,jm) > 1) return;
-      ent=1 ; /* le segment est vertical vers le bas */
-      /* Storing intersection point */
-      (*func)(0,Cont, x_cont(i), 
-               f_intercept(Cont,phi_cont(i,jm),
-                           y_cont(jm),phi_cont(i,j),y_cont(j)));
-      break;
-    case 2 : 
-      if  (get_itg_cont(im,j) == 1 || get_itg_cont(im,j)==3 ) return;
-      ent=2 ; /* le segment est horizontal gauche */
-      /* Storing intersection point */
-      (*func)( 0,Cont,
-               f_intercept(Cont,phi_cont(im,j),
-                           x_cont(im),phi_cont(i,j),x_cont(i)), y_cont(j));
-      break ; 
-    case 3 :
-      if  (get_itg_cont(i,j) > 1 ) return;
-      ent=3 ; /* le segment est vertical haut */
-      /* Storing intersection point */
-      (*func)(0,Cont,x_cont(i), f_intercept(Cont,phi_cont(i,j),
-                                           y_cont(j),phi_cont(i,jp),y_cont(jp)));
-      break ;
-    case 4 :
-      if  (get_itg_cont(i,j) == 1 || get_itg_cont(i,j)==3 ) return;
-      ent=4 ; /* le segment est horizontal droit */
-      /* Storing intersection point */
-      (*func)(0,Cont,f_intercept(Cont,phi_cont(i,j),
-                                x_cont(i),phi_cont(ip,j),x_cont(ip)),
-             y_cont(j));
-      break;
-      default :
-       sciprint(" Error in case wrong value ");
-      break;
-    }
-  wflag=1;
-  while ( wflag) 
-    { 
-      jp= j+1; ip= i+1; jm=j-1;im=i-1;
-      switch  ( ent) 
-       {case 1 :
-         inc_itg_cont(i,jm,2L);
-         ent = ffnd(func,i,ip,ip,i,j,j,jm,jm,ent,qq,Cont,&zds);
-         /* on calcule le nouveau point, ent donne la 
-            direction du segment a explorer */
-         switch ( ent)
-           {
-           case -1: wflag=0; break;
-           case 1 : i=ip ; break ;
-           case 2 : i=ip;j=jm; break ;
-           }
-         break ;
-       case 2  :
-         inc_itg_cont(im,j,1L);
-         ent = ffnd(func,i,i,im,im,j,jm,jm,j,ent,qq,Cont,&zds);
-         switch ( ent)
-           { 
-           case -1: wflag=0; break;
-           case 2 : j = jm ;break ;
-           case  3  : i=im;j=jm; break ;
-           }
-         break ;
-       case 3 :
-         inc_itg_cont(i,j,2L);
-         ent = ffnd(func,i,im,im,i,j,j,jp,jp,ent,qq,Cont,&zds);
-         switch ( ent)
-           { 
-           case -1: wflag=0; break;
-           case 3 : i=im; break ;
-           case 4 : i=im;j=jp; break ;
-           }
-         break ;
-       case 4 :
-         inc_itg_cont(i,j,1L);
-         ent = ffnd(func,i,i,ip,ip,j,jp,jp,j,ent,qq,Cont,&zds);
-         switch ( ent)
-           {
-           case -1: wflag=0; break;
-           case 4 :j=jp;break ;
-           case 1 :i=ip;j=jp;break ;
-           }
-         break ;
-       }
-     
-      /** new segment is on the boundary **/
-      if ( zds == 1) 
-       {
-         switch ( ent) 
-           {
-           case 1 : inc_itg_cont(i,(j-1),2L); break ; 
-           case 2 : inc_itg_cont(i-1,j,1L);  break ; 
-           case 3 : inc_itg_cont(i,j,2L); break ; 
-           case 4 : inc_itg_cont(i,j,1L); break ; 
-           }
-         /** we must quit the while loop **/
-         wflag = 0 ;
-         }
-      /**  init point was inside the domain */
-      if ( qq == 2) 
+      if ( ( zconst = MALLOC( (*nz) * sizeof(double) ) ) == 0 ) 
        {
-         switch ( ent) 
-           {
-           case 1 : if  ( get_itg_cont (i,j-1)  > 1) wflag = 0 ; break ; 
-           case 2 : if  ( oddp(get_itg_cont(i-1,j))) wflag = 0 ; break ; 
-           case 3 : if  ( get_itg_cont(i,j) > 1)     wflag = 0 ; break ; 
-           case 4 : if  ( oddp(get_itg_cont(i,j)))   wflag = 0 ; break ; 
-           }
+         sciprint("Running out of memory\r\n");
+         return 0;
        }
+      for ( i =0 ; i < *nz ; i++) 
+       zconst[i]=zmin + (i+1)*(zmax-zmin)/(*nz+1);
+      N[0]= *n1;N[1]= *n2;N[2]= *nz;
+      contourI(GContStore2,x,y,z,zconst,N,style,&err);
+      FREE(zconst) ;
+      zconst = NULL ;
     }
-  if ( func == GContStore2 ) 
-    GContStore2Last();
-  else 
-    ContourTrace(Cont,style);
+  else
+    {
+      N[0]= *n1;N[1]= *n2;N[2]= *nz;
+      contourI(GContStore2,x,y,z,zz,N,style,&err);
+    }
+
+  return(0);
 }
 
 
+
+
+
 /*-----------------------------------------------------------------------
  *   ffnd : cette fonction  recoit en entree quatre points 
  *       on sait que la courbe de niveau passe entre le point 1 et le quatre 
@@ -606,70 +477,6 @@ static integer ffnd (ptr_level_f func, integer i1, integer i2, integer i3, integ
 
 static integer cont_size ;
 
-/*
- * store a point in the current level curve if ival == 0 the level 
- * curve is reinitialized 
- * used for a contour in a 3D drawing 
- */
-
-static void
-G_ContStore(integer ival, int xncont, int yncont)
-{
-  int n;
-  /* nouveau contour */
-  if ( ival == 0) cont_size =0 ;
-  n= cont_size + 1;
-  xcont = REALLOC( xcont, n * sizeof(int) ) ;
-  ycont = REALLOC( ycont, n * sizeof(int) ) ;
-  if ( ( xcont == NULL || ycont == NULL ) && n != 0 )
-  {
-    FREE( xcont ) ;
-    FREE( ycont ) ;
-
-    return ;
-  }
-  xcont[cont_size]= xncont;
-  ycont[cont_size++]= yncont;
-}
-
-/*
- * store a point in the current level curve if ival == 0 the level 
- * curve is reinitialized 
- * used for a contour in a 3D drawing 
- */
-
-static void
-ContStore(integer ival, double Cont, double xncont, double yncont)
-{
-  G_ContStore(ival,GEOX(xncont,yncont,Cont),
-             GEOY(xncont,yncont,Cont));
-}
-
-/*
- * store a point in the current level curve if ival == 0 the level 
- * curve is reinitialized 
- * used for a contour in a 3D drawing with projection at level ZC 
- */
-
-static void
-ContStore1(integer ival, double Cont, double xncont, double yncont)
-{
-  G_ContStore(ival,GEOX(xncont,yncont,ZC),
-             GEOY(xncont,yncont,ZC));
-}
-
-/*
- * store a point in the current level curve if ival == 0 the level 
- * curve is reinitialized 
- * used for a contour in a 2D drawing 
- */
-
-static void
-ContStore2(integer ival, double Cont, double xncont, double yncont)
-{
-  G_ContStore(ival,XScale(xncont),YScale(yncont));
-}
-
 /* 
  * Explicit drawing of the current level curve with a dash style 
  * The curve level is also drawn as a string according to current 
index 2b90bd9..5246ace 100644 (file)
@@ -20,7 +20,6 @@
 #include <stdarg.h>
 #include <time.h>
 
-#include "Graphics.h" 
 #include "DestroyObjects.h"
 #include "GetProperty.h"
 #include "DrawObjects.h"
@@ -30,6 +29,8 @@
 #include "Xcall1.h"
 #include "WindowList.h"
 #include "PloEch.h"
+#include "sciprint.h"
+
 #ifdef WITH_TK
 #include "../../../tclsci/includes/GedManagement.h"
 #endif
index da28486..326f281 100644 (file)
@@ -18,7 +18,6 @@
 #include <stdarg.h>
 #include <time.h>
 
-#include "Graphics.h"
 #include "DrawObjects.h"
 #include "GetProperty.h"
 #include "bcg.h"
@@ -47,6 +46,7 @@
 #include "periScreen.h" /* to be removed */
 #include "PloEch.h"
 #include "axesScale.h"
+#include "sciprint.h"
 
 #include "math_graphics.h"
 #include "graphicSession.h"
@@ -69,8 +69,6 @@ extern HDC TryToGetDC(HWND hWnd);
 
 extern double C2F(dsort)();/*DJ.A merge*/ 
 extern int scilab_shade(integer *polyx, integer *polyy, integer *fill, integer polysize, integer flag);
-extern void xstringb_angle (char *string, integer x, integer y, integer w, integer h, double angle);
-extern void xstringb_bbox (char *string, integer x, integer y, integer w, integer h, double angle, int *bbox);
 #ifdef _MSC_VER
 extern void Scistring (char *str);
 #endif
@@ -437,2932 +435,6 @@ void Nextind(integer ind1, integer *ind2, integer *ind3)
 }
 
 
-/**Axes3dStrings2
- * @author F.Leray 18.10.04
- * Should be in Axes.c file
- */
-int Axes3dStrings2(integer *ixbox, integer *iybox, integer *xind)
-{
-  integer verbose=0,narg,xz[2],fontid[2],fontsize_kp,color_kp,size;
-  integer iof,barlengthx = 0,barlengthy = 0, posi[2]; 
-  integer rect[4],flag=0,x=0,y=0;
-  double ang=0.0, bbox[6];
-  int fontsize=-1,textcolor=-1,ticscolor=-1;
-  int fontstyle=0; /* F.Leray 08.04.04 */
-  sciPointObj *psubwin = NULL;
-  sciSubWindow * ppsubwin = NULL;
-  int ns=2,iflag=0,gstyle,gridStyle=2,dash[6];
-  double xx[4],yy[4],zz[4],vxx1,vyy1,vzz1;
-  integer i,xm,ym,vx[2],vy[2],xg[2],yg[2],j;
-  integer fontid_old[2], textcolor_old;
-
-  int lastzindex = 0, lastxindex = 0, lastyindex = 0;
-  double xminval, yminval, zminval, xmaxval, ymaxval, zmaxval;
-  int nbtics = 0;
-  int nbsubtics = 0;
-
-  int logrect[4], XX = 0, YY = 0; /* see below */ /* ah ouais ou ca ? */
-  double angle=0.0;
-  
-  int constOffset[2] ; /* displacment of labels from the axes segments. */
-  int maxTicksLabelSize[2] ; /* for each axis the maximum size of ticks label */
-
-
-  psubwin= (sciPointObj *)sciGetSelectedSubWin (sciGetCurrentFigure ());
-  ppsubwin = pSUBWIN_FEATURE (psubwin);
-
-  /** le cot\'e gauche ( c'est tjrs un axe des Z **/
-  xz[0] = Cscale.WIRect1[2] ;
-  xz[1] = Cscale.WIRect1[2] ;
-  iof = (xz[0]+xz[1])/50;
-
-  ticscolor = sciGetForeground(psubwin);
-  textcolor=sciGetFontForeground(psubwin);
-
-  fontsize=sciGetFontDeciWidth(psubwin)/100;
-  fontstyle=sciGetFontStyle(psubwin);
-  
-  if(sciGetEntityType (psubwin) != SCI_SUBWIN) { 
-    sciprint("Impossible case\n");
-    return 0;
-  }
-  
-
-  bbox[0] =  xminval = pSUBWIN_FEATURE (psubwin)->FRect[0]; /*xmin*/
-  bbox[1] =  xmaxval = pSUBWIN_FEATURE (psubwin)->FRect[2]; /*xmax*/
-  bbox[2] =  yminval = pSUBWIN_FEATURE (psubwin)->FRect[1]; /*ymin*/
-  bbox[3] =  ymaxval = pSUBWIN_FEATURE (psubwin)->FRect[3]; /*ymax*/ 
-  bbox[4] =  zminval = pSUBWIN_FEATURE (psubwin)->FRect[4]; /*zmin*/
-  bbox[5] =  zmaxval = pSUBWIN_FEATURE (psubwin)->FRect[5]; /*zmax*/
-  
-  C2F(dr)("xget","font",&verbose,fontid,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-
-  fontid[0]= fontstyle;
-  fontsize_kp = fontid[1] ;
-  if( fontsize == -1 ){ 
-    fontid[1]= 1;
-    C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-  }
-  else {
-    fontid[1] = fontsize ;
-    C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-  }
-  if ( textcolor != -1 || ticscolor != -1 ) 
-    C2F(dr)("xget","pattern",&verbose,&color_kp,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);    
-  for (i=0; i<3 ; i++) {
-    xx[i]=pSUBWIN_FEATURE (psubwin)->axes.xlim[i];
-    yy[i]=pSUBWIN_FEATURE (psubwin)->axes.ylim[i];
-    zz[i]=pSUBWIN_FEATURE (psubwin)->axes.zlim[i];
-  } 
-
-  /* main title */ /* We fix the title always at the top */
-  rect[0]= Cscale.WIRect1[0] ;
-  rect[1]= Cscale.WIRect1[1] ;
-  rect[2]= Cscale.WIRect1[2] ;
-  rect[3]= Cscale.WIRect1[3]/6 ;
-  textcolor_old = textcolor;
-  fontid_old[0] = fontid[0];
-  fontid_old[1] = fontid[1];
-
-  constOffset[0] = Cscale.WIRect1[2] / 50 + 1 ;
-  constOffset[1] = Cscale.WIRect1[3] / 25 + 1 ;
-  
-  if( sciGetVisibility(ppsubwin->mon_title) )
-  {
-    /* get the pointer on the title */
-    sciLabel * ppLabel = pLABEL_FEATURE( ppsubwin->mon_title ) ;
-    
-    /* get position and orientation of the title */
-    if ( ppLabel->auto_rotation )
-    {
-      sciSetFontOrientation( ppsubwin->mon_title, 0 ) ;
-    }
-    
-    if ( ppLabel->auto_position )
-    {
-      /* same as in 2d */
-      int segmentStart[2] = { rect[0] + rect[2], rect[1] } ;
-      int segmentEnd[2]   = { rect[0]          , rect[1] } ;
-      computeLabelAutoPos( ppsubwin->mon_title, segmentStart, segmentEnd, constOffset ) ;
-    }
-    /* draw the label */
-    drawTextEntity( ppLabel->text ) ;
-  }
-  
-  textcolor = textcolor_old;
-  fontid[0] = fontid_old[0];
-  fontid[1] = fontid_old[1];
-
-  size = xz[0]>=xz[1] ? (integer) (xz[1]/50.0) : (integer) (xz[0]/50.0); 
-  
-  /* compute bounding of "10"  string used for log scale ON and auto_ticks ON */
-  C2F(dr)("xstringl","10",&XX,&YY,logrect,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
-
-  /********************************************/
-  /* draw the axis line if axes_visible is on */
-  /********************************************/
-  {
-    int x2[5] ;
-    int two = 2 ;
-    int one = 1 ;
-    int verbose2 = 0 ;
-    int dash2[6] ;
-    int pat ;
-    int narg2 ;
-    x2[0] = sciGetForeground (psubwin);
-    x2[2] = sciGetLineWidth (psubwin) ;
-    x2[3] = sciGetLineStyle (psubwin);
-    x2[4] = 0;
-    C2F(dr)("xget","line style",&verbose2,dash2,&narg2,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 
-    C2F(dr)("xget","pattern",&verbose2,&pat,&narg2,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-    C2F (dr) ("xset", "dashes", x2, x2, x2+4, x2+4, x2+4,PI0,PD0,PD0,PD0,PD0, 5L, 6L);
-    C2F (dr) ("xset","foreground",x2,x2,x2+4,x2+4,x2+4,PI0,PD0,PD0,PD0,PD0,5L,4096); /* F.Leray 05.03.04 Useless too*/
-    C2F (dr) ("xset","thickness",x2+2,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-    C2F (dr) ("xset", "line style", x2+3,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-    if ( ppsubwin->axes.axes_visible[2] )
-    {
-      /* draw the line of the axis like in 2d */
-      /* the two bounds are (ixbox[2],iybox[2]) and (ixbox[2],iybox[2]) */
-      C2F(dr)("xpolys","v",&(ixbox[2]),&(iybox[2]),x2,&one,&two, PI0,PD0,PD0,PD0,PD0,0L,0L);
-    }
-    if ( ( xind[4]+xind[5] == 3) || ( xind[4]+xind[5] == 11 ) )
-    {
-      /* i copy this test but I don't know what it mean... jb Silvy 03/2006 */
-      if ( ppsubwin->axes.axes_visible[1] )
-      {
-        /* draw the line of the axis like in 2d */
-        /* the two bounds are (ixbox[3],iybox[3]) and (ixbox[3],iybox[3]) */
-        C2F(dr)("xpolys","v",&(ixbox[3]),&(iybox[3]),x2,&one,&two, PI0,PD0,PD0,PD0,PD0,0L,0L);
-      }
-      if ( ppsubwin->axes.axes_visible[0] )
-      {
-        /* draw the line of the axis like in 2d */
-        /* the two bounds are (ixbox[4],iybox[4]) and (ixbox[4],iybox[4]) */
-        C2F(dr)("xpolys","v",&(ixbox[4]),&(iybox[4]),x2,&one,&two, PI0,PD0,PD0,PD0,PD0,0L,0L);
-      }
-    }
-    else
-    {
-      if ( ppsubwin->axes.axes_visible[1] )
-      {
-        /* draw the line of the axis like in 2d */
-        /* the two bounds are (ixbox[3],iybox[3]) and (ixbox[3],iybox[3]) */
-        C2F(dr)("xpolys","v",&(ixbox[4]),&(iybox[4]),x2,&one,&two, PI0,PD0,PD0,PD0,PD0,0L,0L);
-      }
-      if ( ppsubwin->axes.axes_visible[0] )
-      {
-        /* draw the line of the axis like in 2d */
-        /* the two bounds are (ixbox[4],iybox[4]) and (ixbox[4],iybox[4]) */
-        C2F(dr)("xpolys","v",&(ixbox[3]),&(iybox[3]),x2,&one,&two, PI0,PD0,PD0,PD0,PD0,0L,0L);
-      }
-    }
-    C2F(dr)("xset","pattern",&pat,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-    C2F(dr)("xset","line style",dash2,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-  }  
-
-  /********************/
-  /*** le z scaling ***/ /* DISPLAY Z graduations */
-  /********************/
-
-
-  if (pSUBWIN_FEATURE (psubwin)->project[2]==1)
-    {
-      double fx,fy,fz; 
-      char c_format[5] ;
-
-      integer Ticsdir[2];
-      Ticsdir[0]=ixbox[3]-ixbox[4]; /* <=> en pixel direction/vecteur non norme(e)s des tics en x */
-      Ticsdir[1]=iybox[3]-iybox[4]; /* <=> idem pour y */
-      /* NB: for a default plot3d (simply calling plot3d in siclab console) */
-      /* Ticsdir[0] & Ticsdir[1] are negative : we do min - max here... */
-
-      BBoxToval(&fx,&fy,&fz,xind[3],bbox); /* xind[3] <=> en bas a gauche <=> zmin */
-      x=ixbox[2]-(xz[0]+xz[1])/20;
-      y=(iybox[3]+iybox[2])/2;
-  
-      /*       NumberFormat(str,((integer) zz[0]),((integer) zz[2])); */
-      
-      
-      if( !ppsubwin->axes.auto_ticks[2] )
-       {
-         /* we display the z tics specified by the user*/
-         nbtics = ppsubwin->axes.u_nzgrads;
-         nbsubtics = ppsubwin->axes.nbsubtics[2];
-
-          maxTicksLabelSize[0] = 0 ;
-          maxTicksLabelSize[1] = 0 ;
-         
-         for(i=0;i<nbtics;i++)
-           {
-             char *foo = ppsubwin->axes.u_zlabels[i]; 
-             double ztmp = ppsubwin->axes.u_zgrads[i];
-             
-             if(ztmp<zminval || ztmp>zmaxval) 
-               {
-                 /*   sciprint("je rejete la valeur: %lf\n\n",xtmp); */
-                 continue; /* cas ou TL est ON et on a des graduations qui ne seront pas affichees de tte facon */
-                 /* donc autant ne pas aller plus loin dans l'algo... */
-               }
-                 
-
-             /***************************************************************/
-             /************************* COMMON PART *************************/
-             /***************************************************************/
-             
-             if( ppsubwin->axes.reverse[2] )
-              {
-               ztmp = InvAxis(ppsubwin->FRect[4],ppsubwin->FRect[5],ztmp);
-              }
-              
-             ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&fy,&ztmp);
-             
-
-             vx[0]=xm;vy[0]=ym;
-
-             barlengthx= (integer) (( Ticsdir[0])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
-             barlengthy= (integer) (( Ticsdir[1])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
-             vx[1]=vx[0]+barlengthx;
-             vy[1]=vy[0]+barlengthy;
-                 
-             /* foo is set above with sprintf(foo,c_format,xtmp); */
-                 
-             C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); /* fix bug noticed by R.N. */
-             
-              /* get the size of ticks label */
-              C2F(dr)("xstringl",foo,&x,&y,rect,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-              maxTicksLabelSize[0] = Max( maxTicksLabelSize[0], rect[2] ) ;
-              maxTicksLabelSize[1] = Max( maxTicksLabelSize[1], rect[3] ) ;
-
-
-             posi[0] = inint( xm+2*barlengthx - rect[2]); 
-             posi[1]=inint( ym + 2*barlengthy + rect[3]/2);
-
-
-             if(ppsubwin->axes.axes_visible[2] == TRUE){
-               C2F(dr)("xset","pattern",&textcolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-               C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-               C2F(dr)("xstring",foo,&(posi[0]),&(posi[1]),PI0,&flag,PI0,PI0,&ang, PD0,PD0,PD0,0L,0L);
-               C2F(dr)("xset","pattern",&ticscolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-               C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-             }
-             /* grid to put here */
-             if ( ppsubwin->grid[2] > -1 && ppsubwin->axes.axes_visible[2] )
-               {
-                 gstyle = pSUBWIN_FEATURE (psubwin)->grid[2];
-
-                 if((ppsubwin->logflags[2] =='l') && (i != nbtics-1))
-                   {
-                     double tmp[2];
-                     double pas=0;
-                     double * tmp_log_grads = (double *) NULL;
-                     
-                     
-                     double * grads = ppsubwin->axes.u_zgrads;
-                     
-                     tmp[0] = exp10(grads[i]);
-                     tmp[1] = exp10(grads[i+1]);
-                     pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
-                     
-                     if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
-                       sciprint("Error allocating tmp_log_grads\n");
-                       return -1;
-                     }
-                     
-                     for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
-                     
-                     for(j=0;j<nbsubtics;j++)
-                       {
-                         vzz1 = tmp_log_grads[j];
-                         
-                         if(vzz1<=zminval || vzz1>=zmaxval) continue;   
-                         
-                         if(ppsubwin->axes.reverse[2] == TRUE)
-                           vzz1 = InvAxis(ppsubwin->FRect[4],ppsubwin->FRect[5],vzz1);
-                                 
-                         ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&fy,&vzz1);
-                         
-                         /*  if ((ym != iybox[3]) && (ym != iybox[2])) */
-                         /*                        { */
-                         C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                         C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                         xg[0]= ixbox[3];yg[0]= ym;
-                         if (Ishidden(psubwin))
-                           {  xg[1]=ixbox[4];  yg[1]= iybox[4]- iybox[3]+ym;}
-                         else
-                           {xg[1]=ixbox[1];  yg[1]= iybox[1]- iybox[2]+ym;}
-                         C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                         xg[0]=xg[1];  ; xg[1] =ixbox[0];
-                         yg[0]=yg[1]; yg[1]= ym- iybox[3]+ iybox[5];
-                         C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                         C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                         /*   } */
-                       }
-                     FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
-                   }
-                 else
-                   { 
-                     if(ztmp>zminval && ztmp<zmaxval) 
-                       {
-                         C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                         C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                         xg[0]= ixbox[3];yg[0]= ym;
-                         if (Ishidden(psubwin))
-                           {  xg[1]=ixbox[4];  yg[1]= iybox[4]- iybox[3]+ym;}
-                         else
-                           {xg[1]=ixbox[1];  yg[1]= iybox[1]- iybox[2]+ym;}
-                         C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                         xg[0]=xg[1];  ; xg[1] =ixbox[0];
-                         yg[0]=yg[1]; yg[1]= ym- iybox[3]+ iybox[5];
-                         C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                         C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                       }
-                   }
-               }
-                 
-             /* and subtics */
-             if(i != nbtics-1)
-               {
-                 if(ppsubwin->logflags[2] =='l')
-                   {
-                     double tmp[2];
-                     double pas=0;
-                     double * tmp_log_grads = (double *) NULL;
-                     
-                     
-                     double * grads = ppsubwin->axes.u_zgrads;
-                     
-                     tmp[0] = exp10(grads[i]);
-                     tmp[1] = exp10(grads[i+1]);
-                     pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
-                     
-                     if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
-                       sciprint("Error allocating tmp_log_grads\n");
-                       return -1;
-                     }
-                     
-                     for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
-                     
-                     for(j=0;j<nbsubtics;j++)
-                       {
-                         vzz1 = tmp_log_grads[j];
-                         
-                         if(vzz1<zminval || vzz1>zmaxval) continue;
-                         
-                         if(ppsubwin->axes.reverse[2] == TRUE)
-                           vzz1 = InvAxis(ppsubwin->FRect[4],ppsubwin->FRect[5],vzz1);
-                         
-                         ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&fy,&vzz1);
-                         
-                         vx[0]=xm;vy[0]=ym;
-                         vx[1]= (integer) (vx[0]+barlengthx/2.0);
-                         vy[1]= (integer) (vy[0]+barlengthy/2.0);
-                         
-                         if(ppsubwin->axes.axes_visible[2] == TRUE)
-                           C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                       }
-                     FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
-                   } /* end NEW */
-                 else
-                   {
-                     double xtmp = ppsubwin->axes.u_zgrads[i];
-                     double dx = (ppsubwin->axes.u_zgrads[i+1] - ppsubwin->axes.u_zgrads[i]) / nbsubtics;
-                     for(j=0;j<nbsubtics;j++)
-                       {
-                         vzz1=xtmp+dx*j;
-                         
-                         if(vzz1<zminval || vzz1>zmaxval) continue;     
-                         
-                         if(ppsubwin->axes.reverse[2] == TRUE)
-                           vzz1 = InvAxis(ppsubwin->FRect[4],ppsubwin->FRect[5],vzz1);
-                         
-                         ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&fy,&vzz1);
-                         /*                  trans3d(psubwin,1,&xm,&ym,&fx,&fy,&vzz1); */
-                         
-                         
-                         vx[0]=xm;vy[0]=ym;
-                         vx[1]= (integer) (vx[0]+barlengthx/2.0);
-                         vy[1]= (integer) (vy[0]+barlengthy/2.0);
-                         
-                         if(ppsubwin->axes.axes_visible[2] == TRUE)
-                           C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                       }
-                   } 
-               }
-             
-             /***************************************************************/
-             /************************* END OF COMMON PART ******************/
-             /***************************************************************/
-           }
-       }
-      else /* we display the computed tics */
-       {
-         AdaptGraduationsOnZ(x,y,size,Ticsdir,fontid,psubwin,zminval,zmaxval,fx,fy,0.);
-
-         lastzindex = ppsubwin->axes.nzgrads - 1;
-         
-         if(lastzindex == 0)
-           ChooseFormatForOneGrad(c_format,&(ppsubwin->axes.zgrads[0]));
-         else
-           ChoixFormatE(c_format,
-                        ppsubwin->axes.zgrads[0],
-                        ppsubwin->axes.zgrads[lastzindex],
-                        ((ppsubwin->axes.zgrads[lastzindex])-(ppsubwin->axes.zgrads[0]))/(lastzindex));
-         
-         nbtics = ppsubwin->axes.nzgrads;
-         nbsubtics = ppsubwin->axes.nbsubtics[2];
-
-          maxTicksLabelSize[0] = 0 ;
-          maxTicksLabelSize[1] = 0 ;
-         
-         for(i=0;i<nbtics;i++)
-           {
-             char foo[256]; 
-             double ztmp = ppsubwin->axes.zgrads[i];
-             
-             if(ztmp<zminval || ztmp>zmaxval) 
-               {
-                 /*   sciprint("je rejete la valeur: %lf\n\n",xtmp); */
-                 continue; /* cas ou TL est ON et on a des graduations qui ne seront pas affichees de tte facon */
-                 /* donc autant ne pas aller plus loin dans l'algo... */
-               }
-             
-             sprintf(foo,c_format,ztmp);
-
-             /***************************************************************/
-             /************************* COMMON PART *************************/
-             /***************************************************************/
-             if(ppsubwin->axes.reverse[2] == TRUE)
-               ztmp = InvAxis(ppsubwin->FRect[4],ppsubwin->FRect[5],ztmp);
-  
-             ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&fy,&ztmp);
-
-             /*              trans3d(psubwin,1,&xm,&ym,&fx,&fy,&ztmp); */
-
-
-             vx[0]=xm;vy[0]=ym;
-
-             barlengthx= (integer) (( Ticsdir[0])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
-             barlengthy= (integer) (( Ticsdir[1])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
-             vx[1]=vx[0]+barlengthx;
-             vy[1]=vy[0]+barlengthy;
-                 
-             /* foo is set above with sprintf(foo,c_format,xtmp); */
-             
-             C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); /* fix bug noticed by R.N. */
-             
-              /* get the size of ticks label */
-              C2F(dr)("xstringl",foo,&x,&y,rect,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-              maxTicksLabelSize[0] = Max( maxTicksLabelSize[0], rect[2] ) ;
-              maxTicksLabelSize[1] = Max( maxTicksLabelSize[1], rect[3] ) ;
-
-              posi[0] = inint( xm+2*barlengthx - rect[2]); 
-             posi[1]=inint( ym + 2*barlengthy + rect[3]/2);
-             
-             if(ppsubwin->axes.axes_visible[2] == TRUE){
-               C2F(dr)("xset","pattern",&textcolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-               C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-               if ( ppsubwin->logflags[2] == 'l' )
-                 {
-                   int smallersize = fontid[1]-2;
-                   int old_rect10[4];
-/*                 char str[2] = "xv"; */
-                   int posi10[2];
-                   
-                   posi10[0] = posi[0] - logrect[2];
-                   posi10[1] = posi[1] + logrect[3];
-
-                   C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                   C2F(dr)("xstring","10",(&posi10[0]),(&posi10[1]),PI0,&flag,PI0,PI0,&angle,PD0,PD0,PD0,0L,0L);
-
-                   C2F(dr)("xstringl","10",(&posi10[0]),(&posi10[1]),old_rect10,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                   
-                   posi[0] = old_rect10[0] + old_rect10[2];
-                   posi[1] = (int) (old_rect10[1] - old_rect10[3]*.1);
-
-                   C2F(dr)("xset","font",fontid,&smallersize,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                   C2F(dr)("xstring",foo,&(posi[0]),&(posi[1]),PI0,&flag,PI0,PI0,&ang, PD0,PD0,PD0,0L,0L);
-                   
-                   /* put back the current fontid */
-                   C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                 }
-               else{
-                 C2F(dr)("xstring",foo,&(posi[0]),&(posi[1]),PI0,&flag,PI0,PI0,&ang, PD0,PD0,PD0,0L,0L);
-               }
-               
-               C2F(dr)("xset","pattern",&ticscolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);   
-               C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-             }
-             /* grid to put here */
-             if ( ppsubwin->grid[2] > -1 && ppsubwin->axes.axes_visible[2] )
-               {
-                 gstyle = pSUBWIN_FEATURE (psubwin)->grid[2];
-
-                 if((ppsubwin->logflags[2] =='l') && (i != nbtics-1))
-                   {
-                     double tmp[2];
-                     double pas=0;
-                     double * tmp_log_grads = (double *) NULL;
-                     
-                     
-                     double * grads = ppsubwin->axes.zgrads;
-                     
-                     tmp[0] = exp10(grads[i]);
-                     tmp[1] = exp10(grads[i+1]);
-                     pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
-                     
-                     if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
-                       sciprint("Error allocating tmp_log_grads\n");
-                       return -1;
-                     }
-                     
-                     for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
-                     
-                     for(j=0;j<nbsubtics;j++)
-                       {
-                         vzz1 = tmp_log_grads[j];
-                         
-                         if(vzz1<=zminval || vzz1>=zmaxval) continue;   
-
-                         if(ppsubwin->axes.reverse[2] == TRUE)
-                           vzz1 = InvAxis(ppsubwin->FRect[4],ppsubwin->FRect[5],vzz1);
-                         
-                         ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&fy,&vzz1);
-                         
-                         /*  if ((ym != iybox[3]) && (ym != iybox[2])) */
-                         /*                        { */
-                         C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                         C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                         xg[0]= ixbox[3];yg[0]= ym;
-                         if (Ishidden(psubwin))
-                           {  xg[1]=ixbox[4];  yg[1]= iybox[4]- iybox[3]+ym;}
-                         else
-                           {xg[1]=ixbox[1];  yg[1]= iybox[1]- iybox[2]+ym;}
-                         C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                         xg[0]=xg[1];  ; xg[1] =ixbox[0];
-                         yg[0]=yg[1]; yg[1]= ym- iybox[3]+ iybox[5];
-                         C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                         C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                         /*   } */
-                       }
-                     FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
-                   }
-                 else
-                   {
-                     if(ztmp>zminval && ztmp<zmaxval) 
-                       {
-                         C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                         C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                         xg[0]= ixbox[3];yg[0]= ym;
-                         if (Ishidden(psubwin))
-                           {  xg[1]=ixbox[4];  yg[1]= iybox[4]- iybox[3]+ym;}
-                         else
-                           {xg[1]=ixbox[1];  yg[1]= iybox[1]- iybox[2]+ym;}
-                         C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                         xg[0]=xg[1];  ; xg[1] =ixbox[0];
-                         yg[0]=yg[1]; yg[1]= ym- iybox[3]+ iybox[5];
-                         C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                         C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                       }
-                   }
-               }
-             
-             /* and subtics */
-             if(i != nbtics-1)
-               {
-                 if(ppsubwin->logflags[2] =='l')
-                   {
-                     double tmp[2];
-                     double pas=0;
-                     double * tmp_log_grads = (double *) NULL;
-                     
-                     
-                     double * grads = ppsubwin->axes.zgrads;
-                     
-                     tmp[0] = exp10(grads[i]);
-                     tmp[1] = exp10(grads[i+1]);
-                     pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
-                     
-                     if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
-                       sciprint("Error allocating tmp_log_grads\n");
-                       return -1;
-                     }
-                     
-                     for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
-                     
-                     for(j=0;j<nbsubtics;j++)
-                       {
-                         vzz1 = tmp_log_grads[j];
-                         
-                         if(vzz1<zminval || vzz1>zmaxval) continue;
-                         
-                         if(ppsubwin->axes.reverse[2] == TRUE)
-                           vzz1 = InvAxis(ppsubwin->FRect[4],ppsubwin->FRect[5],vzz1);
-                         
-                         ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&fy,&vzz1);
-                         
-                         vx[0]=xm;vy[0]=ym;
-                         vx[1]= (integer) (vx[0]+barlengthx/2.0);
-                         vy[1]= (integer) (vy[0]+barlengthy/2.0);
-                         
-                         if(ppsubwin->axes.axes_visible[2] == TRUE)
-                           C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                       }
-                     FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
-                   } /* end NEW */
-                 else
-                   {
-                     double ztmp2 = ppsubwin->axes.zgrads[i];
-                     double dz = (ppsubwin->axes.zgrads[i+1] - ppsubwin->axes.zgrads[i]) / nbsubtics;
-                     for(j=0;j<nbsubtics;j++)
-                       {
-                         vzz1=ztmp2+dz*j;
-                         
-                         if(vzz1<zminval || vzz1>zmaxval) continue;
-                         
-                         if(ppsubwin->axes.reverse[2] == TRUE)
-                           vzz1 = InvAxis(ppsubwin->FRect[4],ppsubwin->FRect[5],vzz1);
-                         
-                         ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&fy,&vzz1);
-                         /*                  trans3d(psubwin,1,&xm,&ym,&fx,&fy,&vzz1); */
-                         
-                         
-                         vx[0]=xm;vy[0]=ym;
-                         vx[1]= (integer) (vx[0]+barlengthx/2.0);
-                         vy[1]= (integer) (vy[0]+barlengthy/2.0);
-                         
-                         if(ppsubwin->axes.axes_visible[2] == TRUE)
-                           C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                       }
-                   }
-               }
-             /***************************************************************/
-             /************************* END OF COMMON PART ******************/
-             /***************************************************************/
-             
-           }
-       }
-    }
-  
-  if ( sciGetVisibility(ppsubwin->mon_z_label) )
-    {
-      /* draw z label */
-      sciLabel * ppLabel = pLABEL_FEATURE(ppsubwin->mon_z_label) ;
-            
-      if ( ppLabel->auto_rotation )
-      {
-        /* mult by 10 because */
-        sciSetFontOrientation(ppsubwin->mon_z_label, 270 * 10 ) ;
-      }
-      
-      if( ppLabel->auto_position )
-      {
-        
-        int segmentStart[2] = { ixbox[2], iybox[2] } ;
-        int segmentEnd[2]   = { ixbox[3], iybox[3] } ;
-        
-        /* add the bar size and ticks label size to the offset */
-        int offset[2] = { constOffset[0] + maxTicksLabelSize[0] + abs( barlengthx ), 
-                          constOffset[1] + maxTicksLabelSize[1] + abs( barlengthy )  } ;
-        computeLabelAutoPos( ppsubwin->mon_z_label, segmentStart, segmentEnd, offset ) ;
-      }
-      /* a trick to force the display with 2d scale */
-      drawTextEntity( ppLabel->text ) ;
-      
-    }
-  
-
-  /***********************/ /** bottom right side ***/
-  /*** le  x-y scaling ***/ /* DISPLAY x or y graduations */
-  /***********************/
-
-  
-  if (( xind[4]+xind[5] == 3) || ( xind[4]+xind[5] == 11))
-    {
-      if (pSUBWIN_FEATURE (psubwin)->project[0]==1) /* x HERE */
-       {
-         double fx,fy,fz;
-         char c_format[5];
-
-         integer Ticsdir[2]; 
-         Ticsdir[0]=ixbox[4]-ixbox[3];
-         Ticsdir[1]=iybox[4]-iybox[3];
-         BBoxToval(&fx,&fy,&fz,xind[4],bbox);
-         x=inint((ixbox[4]+ixbox[5])/2+1.5*rect[2] +iof);
-         y=inint(((2/3.0)*iybox[4]+(1/3.0)*iybox[5])+1.5*rect[3]+iof);
-         
-         if( !ppsubwin->axes.auto_ticks[0] )
-           {
-             /* we display the x tics specified by the user*/
-             nbtics = ppsubwin->axes.u_nxgrads;
-             nbsubtics = ppsubwin->axes.nbsubtics[0];
-             
-              maxTicksLabelSize[0] = 0 ;
-              maxTicksLabelSize[1] = 0 ;
-
-             for(i=0;i<nbtics;i++)
-               {
-                 char *foo = ppsubwin->axes.u_xlabels[i]; 
-                 double xtmp = ppsubwin->axes.u_xgrads[i];
-                 
-                 if(xtmp<xminval || xtmp>xmaxval) 
-                   {
-                     /*   sciprint("je rejete la valeur: %lf\n\n",xtmp); */
-                     continue; /* cas ou TL est ON et on a des graduations qui ne seront pas affichees de tte facon */
-                     /* donc autant ne pas aller plus loin dans l'algo... */
-                   }
-
-                 /***************************************************************/
-                 /************************* COMMON PART *************************/
-                 /***************************************************************/
-                 
-                 if(ppsubwin->axes.reverse[0] == TRUE)
-                   xtmp = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],xtmp);
-                                 
-                 ComputeGoodTrans3d(psubwin,1,&xm,&ym,&xtmp,&fy,&fz);
-                 /*   trans3d(psubwin,1,&xm,&ym,&xtmp,&fy,&fz); */
-
-
-                 vx[0]=xm;vy[0]=ym;
-
-                 barlengthx= (integer) (( Ticsdir[0])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
-                 barlengthy= (integer) (( Ticsdir[1])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
-
-                 C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); /* fix bug noticed by R.N. */
-
-                  /* get the size of the icks label */
-                 C2F(dr)("xstringl",foo,&x,&y,rect,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                  maxTicksLabelSize[0] = Max( maxTicksLabelSize[0], rect[2] ) ;
-                  maxTicksLabelSize[1] = Max( maxTicksLabelSize[1], rect[3] ) ;
-                  
-                  
-                 if (IsDownAxes(psubwin)){
-                   vx[1]=vx[0];
-                   vy[1]=vy[0]+iof/2;
-                   posi[0] = inint(xm-rect[2]/2); 
-                   posi[1]=inint( vy[0] + iof + rect[3]);}
-                 else{
-                   vx[1]=vx[0]+barlengthx;
-                   vy[1]=vy[0]+barlengthy;
-                   posi[0] = inint( xm+2*barlengthx);
-                   posi[1]=inint( ym + 2*barlengthy + rect[3]);}
-                     
-                 if( ppsubwin->axes.axes_visible[0] )
-                  {    
-                   C2F(dr)("xset","pattern",&textcolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                   C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                   C2F(dr)("xstring",foo,&(posi[0]),&(posi[1]),PI0,&flag,PI0,PI0,&ang, PD0,PD0,PD0,0L,0L);
-                   C2F(dr)("xset","pattern",&ticscolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);   
-                   C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                 }
-                 /* grid to put here */
-                 if ( ppsubwin->grid[0] > -1 && ppsubwin->axes.axes_visible[0] )
-                   {
-                     gstyle = pSUBWIN_FEATURE (psubwin)->grid[0];
-
-                     if((ppsubwin->logflags[0] =='l') && (i != nbtics-1))
-                       {
-                         double tmp[2];
-                         double pas=0;
-                         double * tmp_log_grads = (double *) NULL;
-                         
-                         
-                         double * grads = ppsubwin->axes.u_xgrads;
-
-                         tmp[0] = exp10(grads[i]);
-                         tmp[1] = exp10(grads[i+1]);
-                         pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
-                         
-                         if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
-                           sciprint("Error allocating tmp_log_grads\n");
-                           return -1;
-                         }
-                         
-                         for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
-                         
-                         for(j=0;j<nbsubtics;j++)
-                           {
-                             vxx1 = tmp_log_grads[j];
-                             
-                             if(vxx1<=xminval || vxx1>=xmaxval) continue;
-                             
-                             if(ppsubwin->axes.reverse[0] == TRUE)
-                               vxx1 = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],vxx1);
-                             
-                             ComputeGoodTrans3d(psubwin,1,&xm,&ym,&vxx1,&fy,&fz);
-                             
-                             /*  if ((xm != ixbox[5]) && (xm != ixbox[4])) */
-                             /*                                {  */
-                             xg[0]= xm;  yg[0]= ym;  
-                             if (Ishidden(psubwin)) 
-                               { xg[1]= xm; yg[1]= iybox[2] -iybox[3]+ym; }
-                             else
-                               {xg[1]= ixbox[3] - ixbox[4] +xm; yg[1]= iybox[3] - iybox[4] +ym; } 
-                                 
-                             C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                             C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                             C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                             xg[0]= xg[1]; yg[0]= yg[1];
-                             xg[1] = ixbox[3] - ixbox[4] +xm; 
-                             yg[1]=  iybox[2] - iybox[4] +ym;
-                             C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                             C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
-                             /*        } */
-                           }
-                         FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
-                       }
-                     else
-                       {
-                         if(xtmp>xminval && xtmp<xmaxval) 
-                           {
-                             xg[0]= xm;  yg[0]= ym;  
-                             if (Ishidden(psubwin)) 
-                               { xg[1]= xm; yg[1]= iybox[2] -iybox[3]+ym; }
-                             else
-                               {xg[1]= ixbox[3] - ixbox[4] +xm; yg[1]= iybox[3] - iybox[4] +ym; } 
-                             C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                             C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                             C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                             xg[0]= xg[1]; yg[0]= yg[1];
-                             xg[1] = ixbox[3] - ixbox[4] +xm; 
-                             yg[1]=  iybox[2] - iybox[4] +ym;
-                             C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                             C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
-                           }
-                       }
-                   }
-
-                 /* and subtics */
-                 if(i != nbtics-1)
-                   {
-                     if(ppsubwin->logflags[0] =='l')
-                       {
-                         double tmp[2];
-                         double pas=0;
-                         double * tmp_log_grads = (double *) NULL;
-                         
-                         
-                         double * grads = ppsubwin->axes.u_xgrads;
-
-                         tmp[0] = exp10(grads[i]);
-                         tmp[1] = exp10(grads[i+1]);
-                         pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
-                         
-                         if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
-                           sciprint("Error allocating tmp_log_grads\n");
-                           return -1;
-                         }
-                         
-                         for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
-                         
-                         for(j=0;j<nbsubtics;j++)
-                           {
-                             vxx1 = tmp_log_grads[j];
-                             
-                             if(vxx1<xminval || vxx1>xmaxval) continue;
-                             
-                             if(ppsubwin->axes.reverse[0] == TRUE)
-                               vxx1 = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],vxx1);
-                             
-                             ComputeGoodTrans3d(psubwin,1,&xm,&ym,&vxx1,&fy,&fz);
-                             
-                             if (IsDownAxes(psubwin))
-                               {
-                                 vx[1]=vx[0]=xm;
-                                 vy[0]=ym;
-                                 vy[1]=vy[0]+iof/4;
-                               }
-                             else
-                               {
-                                 vx[0]=xm;vy[0]=ym;
-                                 vx[1]= (integer) (vx[0]+barlengthx/2.0);
-                                 vy[1]= (integer) (vy[0]+barlengthy/2.0);
-                               }
-                             
-                             if(ppsubwin->axes.axes_visible[0] == TRUE)
-                               C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                           }
-                         
-                         FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
-                       } /* end NEW */
-                     else
-                       {
-                         double xtmp2 = ppsubwin->axes.u_xgrads[i];
-                         double dx = (ppsubwin->axes.u_xgrads[i+1] - ppsubwin->axes.u_xgrads[i]) / nbsubtics;
-                         
-                         for (j=1;j<nbsubtics;j++)
-                           {  
-                             vxx1=xtmp2+dx*j;
-                             
-                             if(vxx1<xminval || vxx1>xmaxval) continue;
-                             
-                             if(ppsubwin->axes.reverse[0] == TRUE)
-                               vxx1 = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],vxx1);
-                             
-                             ComputeGoodTrans3d(psubwin,1,&xm,&ym,&vxx1,&fy,&fz);
-                             /*                          trans3d(psubwin,1,&xm,&ym,&vxx1,&fy,&fz); */
-
-
-                             if (IsDownAxes(psubwin))
-                               {
-                                 vx[1]=vx[0]=xm;
-                                 vy[0]=ym;
-                                 vy[1]=vy[0]+iof/4;
-                               }
-                             else
-                               {
-                                 vx[0]=xm;vy[0]=ym;
-                                 vx[1]= (integer) (vx[0]+barlengthx/2.0);
-                                 vy[1]= (integer) (vy[0]+barlengthy/2.0);
-                               }
-                             
-                             if(ppsubwin->axes.axes_visible[0] == TRUE)   
-                               C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                           }
-                       }
-                   }
-                 /***************************************************************/
-                 /************************* END OF COMMON PART ******************/
-                 /***************************************************************/
-                 
-               }
-           }
-         else /* we display the computed tics */
-           {
-             AdaptGraduationsOnXBottomRight(iof,x,y,size,Ticsdir,fontid,psubwin,xminval,xmaxval,0.,fy,fz);
-                     
-             lastxindex = ppsubwin->axes.nxgrads - 1;
-             
-             if(lastxindex == 0)
-              {
-               ChooseFormatForOneGrad(c_format,&(ppsubwin->axes.xgrads[0]));
-              }
-             else
-              {
-               ChoixFormatE(c_format,
-                            ppsubwin->axes.xgrads[0],
-                            ppsubwin->axes.xgrads[lastxindex],
-                            ((ppsubwin->axes.xgrads[lastxindex])-(ppsubwin->axes.xgrads[0]))/(lastxindex));
-              }
-              
-             nbtics = ppsubwin->axes.nxgrads;
-             nbsubtics = ppsubwin->axes.nbsubtics[0];
-                    
-              maxTicksLabelSize[0] = 0 ;
-              maxTicksLabelSize[1] = 0 ;
-             for(i=0;i<nbtics;i++)
-               {
-                 char foo[256]; 
-                 double xtmp = ppsubwin->axes.xgrads[i];
-                 
-                 if(xtmp<xminval || xtmp>xmaxval) 
-                   {
-                     /*   sciprint("je rejete la valeur: %lf\n\n",xtmp); */
-                     continue; /* cas ou TL est ON et on a des graduations qui ne seront pas affichees de tte facon */
-                     /* donc autant ne pas aller plus loin dans l'algo... */
-                   }
-                 
-                 sprintf(foo,c_format,xtmp);
-
-                 /***************************************************************/
-                 /************************* COMMON PART *************************/
-                 /***************************************************************/
-                
-
-                 /* F.Leray 03.11.04 Test if log scale to perform a : exp10(x) because trans3d will */
-                 /* re-do a log10() (that is needed for data computations) */
-
-                  if( ppsubwin->axes.reverse[0] )
-                  {
-                   xtmp = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],xtmp);
-                 }
-                  
-                 ComputeGoodTrans3d(psubwin,1,&xm,&ym,&xtmp,&fy,&fz);
-                 
-                 vx[0]=xm;vy[0]=ym; 
-                 
-                 barlengthx= (integer) (( Ticsdir[0])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
-                 barlengthy= (integer) (( Ticsdir[1])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
-
-                 C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); /* fix bug noticed by R.N. */
-
-                  /* get the size of ticks label */
-                 C2F(dr)("xstringl",foo,&x,&y,rect,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                  maxTicksLabelSize[0] = Max( maxTicksLabelSize[0], rect[2] ) ;
-                  maxTicksLabelSize[1] = Max( maxTicksLabelSize[1], rect[3] ) ;
-
-                 if (IsDownAxes(psubwin)){
-                   vx[1]=vx[0];
-                   vy[1]=vy[0]+iof/2;
-                   posi[0] = inint(xm-rect[2]/2); 
-                   posi[1]=inint( vy[0] + iof + rect[3]);}
-                 else{
-                   vx[1]=vx[0]+barlengthx;
-                   vy[1]=vy[0]+barlengthy;
-                   posi[0] = inint( xm+2*barlengthx);
-                   posi[1]=inint( ym + 2*barlengthy + rect[3]);}
-                     
-                 if( ppsubwin->axes.axes_visible[0] )
-                  {
-                   C2F(dr)("xset","pattern",&textcolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                   C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                   if ( ppsubwin->logflags[0] == 'l' )
-                    {
-                      int smallersize = fontid[1]-2;
-                      int old_rect10[4];
-                      int posi10[2];
-                      
-                      posi10[0] = posi[0] - logrect[2];
-                      posi10[1] = posi[1] + logrect[3];
-                      
-                      C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                      C2F(dr)("xstring","10",(&posi10[0]),(&posi10[1]),PI0,&flag,PI0,PI0,&angle,PD0,PD0,PD0,0L,0L);
-                      
-                      C2F(dr)("xstringl","10",(&posi10[0]),(&posi10[1]),old_rect10,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                       
-                      posi[0] = old_rect10[0] + old_rect10[2];
-                      posi[1] = (int) (old_rect10[1] - old_rect10[3]*.1);
-                       
-                      C2F(dr)("xset","font",fontid,&smallersize,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                      C2F(dr)("xstring",foo,&(posi[0]),&(posi[1]),PI0,&flag,PI0,PI0,&ang, PD0,PD0,PD0,0L,0L);
-                       
-                      /* put back the current fontid */
-                      C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                    }
-                   else
-                    {
-                     C2F(dr)("xstring",foo,&(posi[0]),&(posi[1]),PI0,&flag,PI0,PI0,&ang, PD0,PD0,PD0,0L,0L);
-                    }      
-                   C2F(dr)("xset","pattern",&ticscolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);   
-                   C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                 }
-                 /* grid to put here */
-                 if ( ppsubwin->grid[0] > -1 && ppsubwin->axes.axes_visible[0]  )
-                  {
-                    gstyle = pSUBWIN_FEATURE (psubwin)->grid[0];
-                     
-                    if((ppsubwin->logflags[0] =='l') && (i != nbtics-1))
-                    {
-                      double tmp[2];
-                      double pas=0;
-                      double * tmp_log_grads = (double *) NULL;
-                         
-                         
-                      double * grads = ppsubwin->axes.xgrads;
-
-                      tmp[0] = exp10(grads[i]);
-                      tmp[1] = exp10(grads[i+1]);
-                      pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
-                         
-                      if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
-                        sciprint("Error allocating tmp_log_grads\n");
-                        return -1;
-                      }
-                         
-                      for(j=0;j<nbsubtics;j++)
-                      {
-                        tmp_log_grads[j] = log10( tmp[0] + (j) * pas ) ;
-                      }
-                         
-                      for(j=0;j<nbsubtics;j++)
-                      {
-                        vxx1 = tmp_log_grads[j];
-                             
-                        if(vxx1<=xminval || vxx1>=xmaxval) continue;
-                             
-                        if(ppsubwin->axes.reverse[0] == TRUE)
-                          vxx1 = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],vxx1);
-                             
-                        ComputeGoodTrans3d(psubwin,1,&xm,&ym,&vxx1,&fy,&fz);
-                             
-                        /*  if ((xm != ixbox[5]) && (xm != ixbox[4])) */
-                        /*                             {  */
-                        xg[0]= xm;  yg[0]= ym;  
-                        if (Ishidden(psubwin)) 
-                        { xg[1]= xm; yg[1]= iybox[2] -iybox[3]+ym; }
-                        else
-                        {xg[1]= ixbox[3] - ixbox[4] +xm; yg[1]= iybox[3] - iybox[4] +ym; } 
-                                 
-                        C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                        C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                        C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                        xg[0]= xg[1]; yg[0]= yg[1];
-                        xg[1] = ixbox[3] - ixbox[4] +xm; 
-                        yg[1]=  iybox[2] - iybox[4] +ym;
-                        C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                        C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
-                        /*     } */
-                      }
-                      FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
-                    }
-                    else
-                    {
-                      if(xtmp>xminval && xtmp<xmaxval) 
-                      {
-                        xg[0]= xm;  yg[0]= ym;  
-                        if (Ishidden(psubwin)) 
-                        { xg[1]= xm; yg[1]= iybox[2] -iybox[3]+ym; }
-                        else
-                        {xg[1]= ixbox[3] - ixbox[4] +xm; yg[1]= iybox[3] - iybox[4] +ym; } 
-                        C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                        C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                        C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                        xg[0]= xg[1]; yg[0]= yg[1];
-                        xg[1] = ixbox[3] - ixbox[4] +xm; 
-                        yg[1]=  iybox[2] - iybox[4] +ym;
-                        C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                        C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
-                      }
-                    }  
-                  }
-
-                 /* and subtics */
-                 if(i != nbtics-1) /* F.Leray NEW 03.11.04 */
-                   {
-                     
-                     if(ppsubwin->logflags[0] =='l')
-                       {
-                         double tmp[2];
-                         double pas=0;
-                         double * tmp_log_grads = (double *) NULL;
-                         
-                         
-                         double * grads = ppsubwin->axes.xgrads;
-
-                         tmp[0] = exp10(grads[i]);
-                         tmp[1] = exp10(grads[i+1]);
-                         pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
-                         
-                         if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
-                           sciprint("Error allocating tmp_log_grads\n");
-                           return -1;
-                         }
-                         
-                         for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
-                         
-                         for(j=0;j<nbsubtics;j++)
-                           {
-                             vxx1 = tmp_log_grads[j];
-                             
-                             if(vxx1<xminval || vxx1>xmaxval) continue;
-                             
-                             if(ppsubwin->axes.reverse[0] == TRUE)
-                               vxx1 = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],vxx1);
-                             
-                             ComputeGoodTrans3d(psubwin,1,&xm,&ym,&vxx1,&fy,&fz);
-                             
-                             if (IsDownAxes(psubwin))
-                               {
-                                 vx[1]=vx[0]=xm;
-                                 vy[0]=ym;
-                                 vy[1]=vy[0]+iof/4;
-                               }
-                             else
-                               {
-                                 vx[0]=xm;vy[0]=ym;
-                                 vx[1]= (integer) (vx[0]+barlengthx/2.0);
-                                 vy[1]= (integer) (vy[0]+barlengthy/2.0);
-                               }
-                             
-                             if( ppsubwin->axes.axes_visible[0] )
-                               C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                           }
-                         
-                         FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
-                       } /* end NEW */
-                     else
-                       {
-                         double xtmp2 = ppsubwin->axes.xgrads[i];
-                         double dx = (ppsubwin->axes.xgrads[i+1] - ppsubwin->axes.xgrads[i]) / nbsubtics;
-                         
-                         for (j=1;j<nbsubtics;j++)
-                           {  
-                             vxx1=xtmp2+dx*j;
-                             
-                             if(vxx1<xminval || vxx1>xmaxval) continue;
-                             
-                             if(ppsubwin->axes.reverse[0] == TRUE)
-                               vxx1 = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],vxx1);
-                             
-                             ComputeGoodTrans3d(psubwin,1,&xm,&ym,&vxx1,&fy,&fz);
-
-                             if (IsDownAxes(psubwin))
-                               {
-                                 vx[1]=vx[0]=xm;
-                                 vy[0]=ym;
-                                 vy[1]=vy[0]+iof/4;
-                               }
-                             else
-                               {
-                                 vx[0]=xm;vy[0]=ym;
-                                 vx[1]= (integer) (vx[0]+barlengthx/2.0);
-                                 vy[1]= (integer) (vy[0]+barlengthy/2.0);
-                               }
-                         
-                             if(ppsubwin->axes.axes_visible[0] == TRUE)
-                               C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                           }
-                       }
-                   }
-               
-                 /***************************************************************/
-                 /************************* END OF COMMON PART ******************/
-                 /***************************************************************/
-                 
-               }
-           }
-       }
-      if ( sciGetVisibility(ppsubwin->mon_x_label) )
-      {
-        sciLabel * ppLabel = pLABEL_FEATURE( ppsubwin->mon_x_label ) ;
-        if( ppLabel->auto_rotation )
-        {
-          sciSetFontOrientation(ppsubwin->mon_x_label, 0) ;
-        }
-        
-         
-        if( ppLabel->auto_position )
-        {
-
-          int segmentStart[2] = { ixbox[4], iybox[4] } ;
-          int segmentEnd[2]   = { ixbox[5], iybox[5] } ;
-          
-          /* add the bar size and ticks label size to the offset */
-          int offset[2] = { constOffset[0] + maxTicksLabelSize[0] + abs( barlengthx ), 
-                            constOffset[1] + maxTicksLabelSize[1] + abs( barlengthy )  } ;
-          computeLabelAutoPos( ppsubwin->mon_x_label, segmentStart, segmentEnd, offset ) ;
-        }
-        /* a trick to force the display with 2d scale */
-        drawTextEntity( ppLabel->text ) ;
-        
-      }
-    }
-  else
-    {
-      
-      if ( pSUBWIN_FEATURE (psubwin)->project[1]==1) /* y is HERE */
-       {
-         double fx,fy,fz; 
-         char c_format[5];
-      
-         integer Ticsdir[2];
-         Ticsdir[0]=ixbox[4]-ixbox[3];
-         Ticsdir[1]=iybox[4]-iybox[3];
-         BBoxToval(&fx,&fy,&fz,xind[4],bbox);
-         
-         x=inint((ixbox[4]+ixbox[5])/2+1.5*rect[2] +iof);
-         y=inint(((2/3.0)*iybox[4]+(1/3.0)*iybox[5])+1.5*rect[3]+iof);
-
-         if(ppsubwin->axes.auto_ticks[1] == FALSE)
-           {
-             /* we display the y tics specified by the user*/
-             nbtics = ppsubwin->axes.u_nygrads;
-             nbsubtics = ppsubwin->axes.nbsubtics[1];
-
-              maxTicksLabelSize[0] = 0 ;
-              maxTicksLabelSize[1] = 0 ;
-             
-             for(i=0;i<nbtics;i++)
-               {
-                 char *foo = ppsubwin->axes.u_ylabels[i]; 
-                 double ytmp = ppsubwin->axes.u_ygrads[i];
-                 
-                 if(ytmp<yminval || ytmp>ymaxval) 
-                   {
-                     /*   sciprint("je rejete la valeur: %lf\n\n",xtmp); */
-                     continue; /* cas ou TL est ON et on a des graduations qui ne seront pas affichees de tte facon */
-                     /* donc autant ne pas aller plus loin dans l'algo... */
-                   }
-                 
-
-                 /***************************************************************/
-                 /************************* COMMON PART *************************/
-                 /***************************************************************/
-                 
-                 if(ppsubwin->axes.reverse[1] == TRUE)
-                   ytmp = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],ytmp);
-  
-                 ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&ytmp,&fz);
-                 /*              trans3d(psubwin,1,&xm,&ym,&fx,&ytmp,&fz); */
-                 
-
-
-                 vx[0]=xm;vy[0]=ym;
-
-                 barlengthx= (integer) (( Ticsdir[0])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
-                 barlengthy= (integer) (( Ticsdir[1])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
-                 /*    NumberFormat(foo,((integer) (yy[0] + i*ceil((yy[1]-yy[0])/yy[3]))), */
-                 /*                         ((integer) yy[2])); */
-                 C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); /* fix bug noticed by R.N. */
-
-                  /* get the size of the ticks */
-                 C2F(dr)("xstringl",foo,&x,&y,rect,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                  maxTicksLabelSize[0] = Max( maxTicksLabelSize[0], rect[2] ) ;
-                  maxTicksLabelSize[1] = Max( maxTicksLabelSize[1], rect[3] ) ;
-                  
-
-                 if (IsDownAxes(psubwin)){
-                   vx[1]=vx[0];
-                   vy[1]=vy[0]+iof/2;
-                   posi[0] = inint(xm-rect[2]/2); 
-                   posi[1]=inint( vy[0] + iof + rect[3]);}
-                 else{ 
-                   vx[1]=vx[0]+barlengthx;
-                   vy[1]=vy[0]+barlengthy;
-/*                 posi[0] = inint( xm+2*barlengthx - rect[2]/2); */
-/*                 posi[0] = inint( xm+2*barlengthx - rect[2]); */
-                   posi[0] = inint( xm+2*barlengthx);
-                   posi[1]=inint( ym + 2*barlengthy + rect[3]);}
-
-                 if(ppsubwin->axes.axes_visible[1] == TRUE){
-                   C2F(dr)("xset","pattern",&textcolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                   C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                   C2F(dr)("xstring",foo,&(posi[0]),&(posi[1]),PI0,&flag,PI0,PI0,&ang, PD0,PD0,PD0,0L,0L);
-                   C2F(dr)("xset","pattern",&ticscolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
-                   C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                 }
-                 /* grid to put here */
-                 if ( ppsubwin->grid[1] > -1 && ppsubwin->axes.axes_visible[1] )
-                   {
-                     gstyle = pSUBWIN_FEATURE (psubwin)->grid[1];
-
-                     if((ppsubwin->logflags[1] =='l') && (i != nbtics-1))
-                       {
-                         double tmp[2];
-                         double pas=0;
-                         double * tmp_log_grads = (double *) NULL;
-                         
-                         
-                         double * grads = ppsubwin->axes.u_ygrads;
-
-                         tmp[0] = exp10(grads[i]);
-                         tmp[1] = exp10(grads[i+1]);
-                         pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
-                         
-                         if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
-                           sciprint("Error allocating tmp_log_grads\n");
-                           return -1;
-                         }
-                         
-                         for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
-                         
-                         for(j=0;j<nbsubtics;j++)
-                           {
-                             vyy1 = tmp_log_grads[j];
-                             
-                             if(vyy1<=yminval || vyy1>=ymaxval) continue;
-                             
-                             if(ppsubwin->axes.reverse[1] == TRUE)
-                               vyy1 = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],vyy1);
-                             
-                             ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&vyy1,&fz);
-
-                             /*  if ((xm != ixbox[5]) && (xm != ixbox[4])) */
-                             /*                                {  */
-                             xg[0]= xm;  yg[0]= ym;  
-                             if (Ishidden(psubwin))
-                               { xg[1]= xm; yg[1]= iybox[2] -iybox[3]+ym; }
-                             else
-                               {xg[1]= ixbox[3] - ixbox[4] +xm; yg[1]= iybox[3] - iybox[4] +ym; } 
-                             C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                             C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                             C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                             xg[0]= xg[1]; yg[0]= yg[1];
-                             xg[1] = ixbox[3] - ixbox[4] +xm; 
-                             yg[1]=  iybox[2] - iybox[4] +ym;
-                             C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                             C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
-                             /*        } */
-                           }
-                         FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
-                       }
-                     else
-                       {
-                         if(ytmp>yminval && ytmp<ymaxval) 
-                           {
-                             xg[0]= xm;  yg[0]= ym;  
-                             if (Ishidden(psubwin))
-                               { xg[1]= xm; yg[1]= iybox[2] -iybox[3]+ym; }
-                             else
-                               {xg[1]= ixbox[3] - ixbox[4] +xm; yg[1]= iybox[3] - iybox[4] +ym; } 
-                             C2F(dr)("xget","line style",&verbose,dash,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                             C2F (dr) ("xset", "line style",&gridStyle,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                             C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                             xg[0]= xg[1]; yg[0]= yg[1];
-                             xg[1] = ixbox[3] - ixbox[4] +xm; 
-                             yg[1]=  iybox[2] - iybox[4] +ym;
-                             C2F(dr)("xsegs","v", xg, yg, &ns,&gstyle,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                             C2F(dr)("xset","line style",dash,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);  
-                           }
-                       }
-                   }
-
-                 /* and subtics */
-                 if(i != nbtics-1)
-                   {
-                     if(ppsubwin->logflags[1] =='l')
-                       {
-                         double tmp[2];
-                         double pas=0;
-                         double * tmp_log_grads = (double *) NULL;
-                         
-                         
-                         double * grads = ppsubwin->axes.u_ygrads;
-                         
-                         tmp[0] = exp10(grads[i]);
-                         tmp[1] = exp10(grads[i+1]);
-                         pas = (exp10(grads[i+1]) - exp10(grads[i])) / (nbsubtics );
-                         
-                         if((tmp_log_grads = (double *)MALLOC(nbsubtics*sizeof(double)))==NULL){
-                           sciprint("Error allocating tmp_log_grads\n");
-                           return -1;
-                         }
-                         
-                         for(j=0;j<nbsubtics;j++) tmp_log_grads[j] = log10(tmp[0]+(j)*pas);
-                         
-                         for(j=0;j<nbsubtics;j++)
-                           {
-                             vyy1 = tmp_log_grads[j];
-                             
-                             if(vyy1<yminval || vyy1>ymaxval) continue;
-                             
-                             if(ppsubwin->axes.reverse[1] == TRUE)
-                               vyy1 = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],vyy1);
-                             
-                             ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&vyy1,&fz);
-                             
-                             if (IsDownAxes(psubwin))
-                               {
-                                 vx[1]=vx[0]=xm;
-                                 vy[0]=ym;
-                                 vy[1]=vy[0]+iof/4;
-                               }
-                             else
-                               {
-                                 vx[0]=xm;vy[0]=ym;
-                                 vx[1]= (integer) (vx[0]+barlengthx/2.0);
-                                 vy[1]= (integer) (vy[0]+barlengthy/2.0);
-                               }
-                             
-                             if(ppsubwin->axes.axes_visible[1] == TRUE)
-                               C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                           }
-                         FREE(tmp_log_grads); tmp_log_grads = (double *) NULL;
-                         
-                       } /* end NEW */
-                     else
-                       {
-                         double ytmp2 = ppsubwin->axes.u_ygrads[i];
-                         double dy = (ppsubwin->axes.u_ygrads[i+1] - ppsubwin->axes.u_ygrads[i]) / nbsubtics;
-                         for(j=0;j<nbsubtics;j++)
-                           {
-                             vyy1=ytmp2+dy*j;
-                             
-                             if(vyy1<yminval || vyy1>ymaxval) continue;
-                             
-                             if(ppsubwin->axes.reverse[1] == TRUE)
-                               vyy1 = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],vyy1);
-                             
-                             ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&vyy1,&fz);
-                                                     
-                             if (IsDownAxes(psubwin))
-                               {
-                                 vx[1]=vx[0]=xm;
-                                 vy[0]=ym;
-                                 vy[1]=vy[0]+iof/4;
-                               }
-                             else
-                               {
-                                 vx[0]=xm;vy[0]=ym;
-                                 vx[1]= (integer) (vx[0]+barlengthx/2.0);
-                                 vy[1]= (integer) (vy[0]+barlengthy/2.0);
-                               }
-                             
-                             if(ppsubwin->axes.axes_visible[1] == TRUE)
-                               C2F(dr)("xsegs","v", vx, vy, &ns,&ticscolor,&iflag,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                           }
-                       }
-                   }
-                 
-                 /***************************************************************/
-                 /************************* END OF COMMON PART ******************/
-                 /***************************************************************/
-               }
-           }
-         else /* we display the computed tics */
-           {
-             AdaptGraduationsOnYBottomRight(iof,x,y,size,Ticsdir,fontid,psubwin,yminval,ymaxval,fx,0.,fz);
-
-             lastyindex = ppsubwin->axes.nygrads - 1;
-             
-             if(lastyindex == 0)
-               ChooseFormatForOneGrad(c_format,&(ppsubwin->axes.ygrads[0]));
-             else
-               ChoixFormatE(c_format,
-                            ppsubwin->axes.ygrads[0],
-                            ppsubwin->axes.ygrads[lastyindex],
-                            ((ppsubwin->axes.ygrads[lastyindex])-(ppsubwin->axes.ygrads[0]))/(lastyindex));
-             
-             nbtics = ppsubwin->axes.nygrads;
-             nbsubtics = ppsubwin->axes.nbsubtics[1];
-            
-              maxTicksLabelSize[0] = 0 ;
-              maxTicksLabelSize[1] = 0 ;
-             for(i=0;i<nbtics;i++)
-               {
-                 char foo[256]; 
-                 double ytmp2 = ppsubwin->axes.ygrads[i];
-             
-                 if(ytmp2<yminval || ytmp2>ymaxval) 
-                   {
-                     /*   sciprint("je rejete la valeur: %lf\n\n",xtmp); */
-                     continue; /* cas ou TL est ON et on a des graduations qui ne seront pas affichees de tte facon */
-                     /* donc autant ne pas aller plus loin dans l'algo... */
-                   }
-             
-                 sprintf(foo,c_format,ytmp2);
-
-                 /***************************************************************/
-                 /************************* COMMON PART *************************/
-                 /***************************************************************/
-
-                 /* F.Leray 03.11.04 Test if log scale to perform a : exp10(x) because trans3d will */
-                 /* re-do a log10() (that is needed for data computations) */
-
-
-                 if(ppsubwin->axes.reverse[1] == TRUE)
-                   ytmp2 = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],ytmp2);
-                 
-                 ComputeGoodTrans3d(psubwin,1,&xm,&ym,&fx,&ytmp2,&fz);
-                 
-                 
-                 vx[0]=xm;vy[0]=ym;
-             
-                 barlengthx= (integer) (( Ticsdir[0])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
-                 barlengthy= (integer) (( Ticsdir[1])/sqrt((double) Ticsdir[0]*Ticsdir[0]+Ticsdir[1]*Ticsdir[1])*size);
-                   
-                 C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); /* fix bug noticed by R.N. */
-                 
-                  
-                  C2F(dr)("xstringl",foo,&x,&y,rect,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                  maxTicksLabelSize[0] = Max( maxTicksLabelSize[0], rect[2] ) ;
-                  maxTicksLabelSize[1] = Max( maxTicksLabelSize[1], rect[3] ) ;
-
-                 if (IsDownAxes(psubwin)){
-                   vx[1]=vx[0];
-                   vy[1]=vy[0]+iof/2;
-                   posi[0] = inint(xm-rect[2]/2); 
-                   posi[1]=inint( vy[0] + iof + rect[3]);}
-                 else{ 
-                   vx[1]=vx[0]+barlengthx;
-                   vy[1]=vy[0]+barlengthy;
-/*                 posi[0] = inint( xm+2*barlengthx - rect[2]/2); */
-/*                 posi[0] = inint( xm+2*barlengthx - rect[2]); */
-                   posi[0] = inint( xm+2*barlengthx);
-                   posi[1]=inint( ym + 2*barlengthy + rect[3]);}
-                 
-                 if(ppsubwin->axes.axes_visible[1] == TRUE){
-                   C2F(dr)("xset","pattern",&textcolor,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                   C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                   if ( ppsubwin->logflags[1] == 'l' )
-                     {
-                       int smallersize = fontid[1]-2;
-                       int old_rect10[4];
-                       /*                  char str[2] = "xv"; */
-                       int posi10[2];
-                       
-                       posi10[0] = posi[0] - logrect[2];
-                       posi10[1] = posi[1] + logrect[3];
-                       
-                       C2F(dr)("xset","font",fontid,fontid+1,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-                       C2F(dr)("xstring","10",(&posi10[0]),(&posi10[1]),PI0,&flag,PI0,PI0,&angle,PD0,PD0,PD0,0L,0L);
-                       
-                       C2F(dr)("xstringl","10",(&posi10[0]),(&posi10[1]),old_rect10,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);