Menu

#660 Plots with the 'unknown' terminal now produce obvious output

None
closed-accepted
nobody
None
5
2017-05-31
2014-03-08
dima
No

If you build gnuplot without interactive graphical terminals (x11, qt, wxt, etc.) then gnuplot defaults to the 'unknown' terminal. By design this terminal does nothing and produces no output. This looks mysterious to a user who doesn't know they are using this terminal. The attached patch prints a message if you try to make plots using this 'unknown' terminal.

1 Attachments

Discussion

  • Ethan Merritt

    Ethan Merritt - 2014-03-08
    • status: open --> pending-accepted
    • Group: -->
     
  • Ethan Merritt

    Ethan Merritt - 2014-03-19
    • status: pending-accepted --> closed-accepted
     
  • Valdas Jankūnas

    I do plot to 'unknown' terminal on purporose. How to supress this warning in a script?

     
  • Ethan Merritt

    Ethan Merritt - 2017-05-31

    The warning is printed to stderr, so I suppose you could redirect stderr.
    But why would you want to do this?
    Maybe there is a better way.

     
  • Valdas Jankūnas

    I use 'unknown' because I want get ranges of axis before actual ploting.

     
    • Ethan Merritt

      Ethan Merritt - 2017-06-01

      Ugh.  That seems like a terrible hack to me.  Use of the "unknown" state for any purpose is undocumented and unsupported. 

      The suggestion in that StackOverflow thread to use the "stats" command instead of a dummy plot seems much better to me.

      Best of all might be to plot once using the real current terminal, then reset the axis ranges and plot again.  I realize you asked about a use inside a multiplot.  In that context you would need to back up one plot position using the "previous" keyword so that the 2nd version of the plot replaces the first one.   Conceptually like this:

        set multiplot layout N, M
        # First subplot
        set auto xy
        plot foo
        min = (GPVAL_Y_MIN<GPVAL_X_MIN) ? GPVAL_Y_MIN : GPVAL_X_MIN
        max = (GPVAL_Y_MAX>GPVAL_X_MAX) ? GPVAL_Y_MAX : GPVAL_X_MAX
        set xrange[min:max]; set yrange[min:max];
        set multiplot previous
        clear
        replot
        # Second subplot
        set auto xy
        plot baz
         ... rinse and repeat
      

      As noted on the StackOverflow thread, you can wrap all the identically repeated commands in a string and then invoke it either as a macro or via eval(commandstring).

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.