Menu

#590 Changed the graph title to y axis

closed-fixed
nobody
None
5
2012-07-23
2012-07-13
Moorkh
No

This is in response to bug report #3542065

I have created new variables which store the field names and make the last encountered one as the title

Discussion

  • Moorkh

    Moorkh - 2012-07-13

    the diff file between the gnuplot4.6.0 directories

     
  • Ethan Merritt

    Ethan Merritt - 2012-07-13

    What is the logic for using "the last encountered" field name as the title? It seems if anything less likely to be correct than the current default of using the first one. Consider a plot that normalizes each of 5 entries to its fraction of the total:
    plot for [N=1:5] ( column(N) / ($1+$2+$3+$4+$5) ) title column
    currently this will produce the expected titles, but your proposed alternative would label all the plots with the header of column 5.

    Note: In the future, please use "diff -urp" to create a patch file.

    Anyhow, thanks for the patch but if you want people to test it then please make sure it actually applies and works. There are clear errors in the version of the patch as given, making it impossible to test. This bit, for example, will overwrite the stack immediately and it is not clear what was intended instead.
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    @@ -2116,7 +2122,16 @@ f_column(union argument *arg)
    {
    struct value a;
    int column;
    -
    + bool is_already_used = FALSE;
    + int i;
    + for (i = 0; i < num_using_var; i++){
    + if (strcmp(a.v.string_val,using_vars[i])){
    + is_already_used = TRUE;
    + }
    + }
    + if (!is_already_used){
    + memcpy(&is_already_used, &a.v.string_val, strlen(a.v.string_val));
    + }
    (void) arg; /* avoid -Wunused warning */
    (void) pop(&a);

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

     
  • Ethan Merritt

    Ethan Merritt - 2012-07-13

    Apologies. The test command should have been:
    plot for [N=1:3] 'file' using 0:(column(N)/($1+$2+$3+$4+$5)) ti columnhead(N)

    It would be nice if the command worked without "ti columnhead(N)" when you have already said "set key autotitle columnhead". I thought that was working, but apparently not yet in version 4.6. So apart from whether the auto default column is the first one or the last one, if your patch makes "set key autotitle columnhead" work that's already useful.

     
  • Moorkh

    Moorkh - 2012-07-14

    Sorry, I am new to the open source world so didnt know about the way diff was supposed to work.

    The patch was intended to help out for the case ' using "x":"y" '

    I am trying to make the changes as suggested. I will submit a new patch once I am done

    Thanks

     
  • Ethan Merritt

    Ethan Merritt - 2012-07-23

    A fix for the specific case in the original bug report is now in CVS. If you develop a revised patch that adds functionality, please open a new tracker item for it.

     
  • Ethan Merritt

    Ethan Merritt - 2012-07-23
    • status: open --> closed-fixed
     

Log in to post a comment.