diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index eea7163bd3e5147f581536e9b54cc36f6313df3e..ade49a03a9e5db2cc53bf0eea56c7affa8dc878c 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -365,12 +365,12 @@ StringXString PostProcessingOptions_String[] = { StringXString ViewOptions_String[] = { { F|O, "AbscissaName" , opt_view_abscissa_name , "" , "Abscissa name for 2D graphs" }, - { F|O, "AbscissaFormat" , opt_view_abscissa_format , "%g" , + { F|O, "AbscissaFormat" , opt_view_abscissa_format , "%.3g" , "Abscissa number format for 2D graphs (in standard C form)" }, { F, "FileName" , opt_view_filename , "" , "Default post-processing view file name" }, - { F|O, "Format" , opt_view_format , "%g" , + { F|O, "Format" , opt_view_format , "%.3g" , "Number format (in standard C form)" }, { F|O, "GeneralizedRaiseX" , opt_view_gen_raise0 , "v0" , diff --git a/Graphics/Graph2D.cpp b/Graphics/Graph2D.cpp index 16358634be773ffb22012ffb4de0baa8ecd848f4..9ee29889e4573ea36cdae61bd663179886eaeaa4 100644 --- a/Graphics/Graph2D.cpp +++ b/Graphics/Graph2D.cpp @@ -1,4 +1,4 @@ -// $Id: Graph2D.cpp,v 1.44 2005-01-09 21:36:47 geuzaine Exp $ +// $Id: Graph2D.cpp,v 1.45 2005-01-18 06:22:03 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -199,8 +199,11 @@ static void Draw_Graph2D(Post_View * v, glColor4ubv((GLubyte *) & CTX.color.text); if(v->Type == DRAW_POST_2D_SPACE && ((v->ShowTime == 1 && List_Nbr(v->Time) > 1) || - (v->ShowTime == 2 && List_Nbr(v->Time) > 0))) - sprintf(label, "%s (%g)", v->Name, *(double *)List_Pointer(v->Time, v->TimeStep)); + (v->ShowTime == 2 && List_Nbr(v->Time) > 0))){ + char tmp[256]; + sprintf(tmp, v->Format, *(double *)List_Pointer(v->Time, v->TimeStep)); + sprintf(label, "%s (%s)", v->Name, tmp); + } else sprintf(label, "%s", v->Name); glRasterPos2d(xtop, ytop + font_h + tic);