help-octave
[Top][All Lists]
Advanced

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

Re: Gnuplot 4.6


From: Ben Abbott
Subject: Re: Gnuplot 4.6
Date: Sat, 14 Dec 2013 17:46:00 -0500

On Dec 14, 2013, at 3:42 PM, Juan Pablo Carbajal <address@hidden> wrote:

> On Sat, Dec 14, 2013 at 8:08 PM, Benjamin Abbott <address@hidden> wrote:
>> On Dec 14, 2013, at 1:11 PM, Juan Pablo Carbajal <address@hidden> wrote:
>>> 
>>>> On Sat, Dec 14, 2013 at 6:30 PM, Ben Abbott <address@hidden> wrote:
>>>>> On Dec 14, 2013, at 11:50 AM, Juan Pablo Carbajal <address@hidden> wrote:
>>>>> 
>>>>>> On Sat, Dec 14, 2013 at 5:36 PM, Ben Abbott <address@hidden> wrote:
>>>>>> 
>>>>>>> On Dec 14, 2013, at 7:16 AM, Juan Pablo Carbajal <address@hidden> wrote:
>>>>>>> 
>>>>>>> Hi Ben,
>>>>>>> 
>>>>>>> I have seem some amazing improvements on gnuplot quality by adding the
>>>>>>> cairo library. Is GNU Octave exploiting this extended features
>>>>>>> already?
>>>>>>> http://gnuplot.sourceforge.net/demo_svg/
>>>>>> 
>>>>>> I don't think so. When I rewrote the print functionality to allow for 
>>>>>> multiple toolkits, I tried to streamline everything as much as possible 
>>>>>> to reduce maintenance and bugs. My approach was to have the print() 
>>>>>> behave similarly for all toolkits.  Unless there are changes I'm unaware 
>>>>>> of, the FLTK and gnuplot toolkits each begin by creating a eps-file and 
>>>>>> then convert it to the desired format using epstool, epstoedit, 
>>>>>> transfig, and/or ghostscript.
>>>>>> 
>>>>>> For gnuplot, it is possible to do things differently, but there will be 
>>>>>> other features.  For example, the linestyles and markertypes are not 
>>>>>> consistent across different terminals.  Surprisingly even the fontsize 
>>>>>> may change across different terminals (specifying a fontsize of 12 
>>>>>> points doesn't always mean you'll get a a font with a size of 12 
>>>>>> points).  All of this manageable, but since these features are 
>>>>>> opportunities for bugs, I choose to avoid them in the initial 
>>>>>> implementation.
>>>>>> 
>>>>>> Ben
>>>>> 
>>>>> Do you think is possible to have the cairo terminal as an option for
>>>>> the gnuplot toolkit?
>>>> 
>>>> I'm not clear on the details of what you'd like to do.
>>>> 
>>>> If you just want to switch from "set term postscript eps ..." to "set term 
>>>> epscairo ...", that should be fairly straight forward.  The 
>>>> __gnuplot_has_feature__() function will likely need to be modified to 
>>>> check if the epscairo terminal is supported.  And the "set term ..." 
>>>> command will need to be modified to support the syntax for epscairo.  The 
>>>> terminal commands are below.
>>>> 
>>>> set terminal postscript {landscape | portrait | eps}
>>>>       {enhanced | noenhanced}
>>>>       {defaultplex | simplex | duplex}
>>>>       {fontfile [add | delete] "<filename>" | nofontfiles} 
>>>> {{no}adobeglyphnames}
>>>>       {level1 | leveldefault}
>>>>       {color | colour | monochrome}
>>>>       {background <rgbcolor> | nobackground}
>>>>       {solid | dashed}
>>>>       {dashlength | dl <DL>}
>>>>       {linewidth | lw <LW>}
>>>>       {rounded | butt}
>>>>       {clip | noclip}
>>>>       {palfuncparam <samples>{,<maxdeviation>}}
>>>>       {size <XX>{unit},<YY>{unit}}
>>>>       {blacktext | colortext | colourtext}
>>>>       {{font} "fontname{,fontsize}" {<fontsize>}}
>>>>       {fontscale <scale>}
>>>> 
>>>> set term epscairo ...
>>>>       {{no}enhanced} {mono|color} {solid|dashed}
>>>>       {font <font>} {fontscale <scale>}
>>>>       {linewidth <lw>} {rounded|butt} {dashlength <dl>}
>>>>        {size <XX>{unit},<YY>{unit}}
>>>> 
>>>> Ben
>>> 
>>> that's pretty concrete!
>>> I was thinking to add this one
>>> 
>>> set term svg enhanced
>>> 
>>> I guess is the same chore, I will look into it.
>> 
>> That will be more difficult, and will make the code hard to follow.  If you 
>> want to produce svg output using gnuplot, you can use the drawnow() function.
>> 
>> I'm not on front of my computer now, and am not confident about the exact 
>> syntax, but "help drawnow" should clear that up.
>> 
>> Off the top of my head, the syntax is something like ...
>> 
>> drawnow("svg", "/dev/null", false, " plot.svg")
>> 
>> Ben
> 
> I did not get that one. I can print to svg, no problem. the issue is
> that then I usually spend some time making the plot more attractive.
> The svg output on the demo site of gnuplot 4.6 already look quite
> nice, they are using the svg enhanced terminal. Therefore my question.

Ok. Now I'm in front of my computer.  My recollection of how the print() 
function was implemented for gnuplot was wrong.

The following works for me.

        graphics_toolkit gnuplot
        close all
        plot (rand (3))
        print -dpdfcairo cairo.pdf
        print -dpngcairo cairo.png
        print cairo.svg

If the svg output isn't what you expect, please try the drawnow function to 
save the gnuplot plot-stream.

        drawnow ("svg", "test.svg", false, "debug.gp")

Then you can examine the plot-stream and hopefully find the problem.  For 
reference, mine includes the line below.

        set terminal svg enhanced size 560,420 

Ben



reply via email to

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