octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Device list for printing


From: Rik
Subject: Re: Device list for printing
Date: Fri, 20 Feb 2015 09:58:17 -0800

On 02/20/2015 09:00 AM, address@hidden wrote:
Subject:
Should DEVICE list in print() help be dependent upon graphics toolkit gnuplot/fltk/qt?
From:
Daniel J Sebald <address@hidden>
Date:
02/19/2015 05:28 PM
To:
address@hidden
List-Post:
<mailto:address@hidden>
Content-Transfer-Encoding:
7bit
Precedence:
list
MIME-Version:
1.0
Message-ID:
<address@hidden>
Content-Type:
text/plain; charset=ISO-8859-1; format=flowed
Message:
3

If one displays the "help print", he or she will find a list of devices that is outdated.

See http://www.mathworks.com/help/matlab/ref/print.html and the Printer Driver subsection for a device list that we should strive to support.  Maybe we need to update the documentation.


  In the case of gnuplot, a couple devices are missing from the list.  In the case of fltk/qt many of those devices aren't valid.

I don't think they are invalid for FLTK/Qt.  If the user asks for a format that is not natively supported by gl2ps (eps, ps, pdf, svg) then Octave generates an eps file and uses ghostscript to turn it into the correct format.  I just tried with hpgl and aifm, two rather esoteric formats, and it worked fine.

  Should an accurate list be generated somehow?  For example, in "help print" we could refer to graphics_toolkit and add an option to graphics_toolkit, e.g.,

graphics_toolkit (TLKTNAME, "devices");

          The available gnuplot output format DEVICE options for print()
          is one of:

         `ps'
         `ps2'
         `psc'
         `psc2'
               PostScript (level 1 and 2, mono and color).  The FLTK
               graphics toolkit generates PostScript level 3.0.

etc.

Looking at the Matlab documentation, it looks like we should change the defaults so that ps/psc produces PostScript level 3.0 and ps2/psc2 produce Postscript level 2.0.


In the case of gnuplot, one could use the system() command to get a list of gnuplot terminals.  But if it were just some ASCII text inside the graphics_toolkit() function that needs to be updated from time to time, that would work too.

There is already this documentation about the ghostscript terminal:

For a complete list, type `system ("gs -h")' to see what formats and devices are available.

And we do the same thing with gnuplot that we do for OpenGL by using eps and ghostscript to turn one format into another.  I just tried

graphics_toolkit gnuplot
plot (1:10)
plot -dljet2p tmp.2p

and this works to create the very esoteric Laserjet2 format.  I don't think we need to be concerned about all of the shifting terminals that gnuplot has based on version number.

Also, note that the demo/test examples in "graphics_toolkit.m" are probably outdated because they don't account for the "qt" toolkit. E.g., if old_toolkit ends up being "qt", new_toolkit won't be defined.

The tests are actually fine.  The case statement is using an "otherwise" statement so even if the toolkit is qt, new_toolkit will be defined.  However, both of these are under %!testif HAVE_FLTK conditionals.  It would be better to re-write this to use available_graphics_toolkits and as long as the list returned is 2 or more, then switch from one toolkit to the other to verify this.

If we get qt plotting for the CLI then I think it would be good to review all of the %!testif HAVE_FLTK conditionals and see if they can become just %!test.

--Rik

reply via email to

[Prev in Thread] Current Thread [Next in Thread]