help-octave
[Top][All Lists]
Advanced

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

Re: Differences between graphics_toolkits, greek letters


From: Ben Abbott
Subject: Re: Differences between graphics_toolkits, greek letters
Date: Fri, 20 Jan 2012 17:48:01 -0500

On Jan 20, 2012, at 5:36 PM, Walter White wrote:

> Am 20.01.2012 01:54, schrieb Ben Abbott:
>> 
>> On Jan 19, 2012, at 2:04 PM, Ben Abbott wrote:
>> 
>>> On Jan 18, 2012, at 11:09 AM, Ben Abbott wrote:
>>> 
>>>> On Jan 18, 2012, at 10:03 AM, Walter White wrote:
>>>> 
>>>>> Hello,
>>>>> 
>>>>> I have some questions about the different graphics toolkits available in 
>>>>> Octave
>>>>> and hope that you can help me as I could not find any documentation on 
>>>>> this topic.
>>>>> (Octave 3.4.3, Windows 7)
>>>>> 
>>>>> Which toolkit is recommended to date? Where are the main differences?
>>>>> Is the support for gnuplot being dropped in the future?
>>>>> 
>>>>> Which toolkit provides more possibilities, in my case primary related to 
>>>>> printing figures to
>>>>> files, but also other common possibilities?
>>>>> 
>>>>> I ran the script attached below to examine the labelling of plots by 
>>>>> gnuplot and fltk
>>>>> and fltk does not print any greek letters. Is it possible?
>>>>> 
>>>>> Gnuplot does not support greek letters in the legend, do you know a
>>>>> way to achieve this?
>>>>> 
>>>>> Kind regards,
>>>>> Walter
>>>>> 
>>>>> -----------------------------------
>>>>> x = 1:10
>>>>> y = rand(10,1)
>>>>> 
>>>>> label_string = '\eta_{efficiency} \epsilon^{2} \lambda \lambda \circ 
>>>>> \alpha'
>>>>> 
>>>>> graphics_toolkit('gnuplot')
>>>>> legend = sprintf('r-;%s;',label_string);
>>>>> plot(x,y,legend)
>>>>> 
>>>>> ylabel(label_string)
>>>>> xlabel(label_string)
>>>>> title(label_string)
>>>>> print_filename = sprintf('./test_gnuplot.png')
>>>>> print(print_filename, '-dpng','-FHelvetica:8','-S1024,768')
>>>>> close all
>>>>> 
>>>>> graphics_toolkit('fltk')
>>>>> 
>>>>> legend = sprintf('r-;%s;',label_string);
>>>>> plot(x,y,legend)
>>>>> 
>>>>> ylabel(label_string)
>>>>> xlabel(label_string)
>>>>> title(label_string)
>>>>> print_filename = sprintf('./test_fltk.png')
>>>>> print(print_filename, '-dpng','-FHelvetica:8','-S1024,768')
>>>>> close all
>>>> 
>>>> The gnuplot toolkit is still the default.
>>>> 
>>>> The "\circ" command is not supported by Octave. I use \circ in LaTeX quite 
>>>> often, but is \circ a valid "TeX" command ?
>>>> 
>>>> In any event, using the gnuplot toolkit with Octave-3.4.0 and with the 
>>>> current developers sources, the following works for me.
>>>> 
>>>>    x = 1:10
>>>>    y = rand(10,1)
>>>>    label_string = '\eta_{efficiency} \epsilon^{2} \lambda \lambda \alpha'
>>>>    plot (x, y)
>>>>    legend (label_string)
>>>>    ylabel(label_string)
>>>>    xlabel(label_string)
>>>>    title(label_string)
>>>> 
>>>> Something is wrong with the implementation for the syntax below.
>>>> 
>>>>    plot (x, y, sprintf (";%s;", label_string))
>>>> 
>>>> A bug report needs to be filed. But that will have to wait until after the 
>>>> blackout.
>>>> 
>>>>    https://savannah.gnu.org/bugs/?func=additem&group=octave
>>>> 
>>>> Ben
>>> 
>>> I filed a bug report.
>>> 
>>>     https://savannah.gnu.org/bugs/index.php?35330
>>> 
>>> Ben
>> 
>> I've pushed a changeset.
>> 
>>      http://hg.savannah.gnu.org/hgweb/octave/rev/35903f035390
>> 
>> Walter, the part you need is the change to __pltopt__.m. The change there is 
>> trivial. If you are inclined, you can edit your copy of __pltopt__.m and 
>> make the change yourself.
>> 
>> Ben
> 
> Hello,
> 
> I have another similar question and hope that you can help me again.
> 
> I would like to use "°C" within the legend but I could not figure out
> how to do this. The strange thing is that the following script displays the 
> "°C" correctly in the "Figure 1" popup window but the printed png-file lacks 
> the "°".
> 
> Any thoughts on this?
> Cheers,
> Walter
> ------------
> graphics_toolkit('gnuplot')
> 
> x = 1:10
>       y = rand(10,1)
>       label_string = '123 °C'
>       plot (x, y)
>       legend (label_string)
>       ylabel(label_string)
>       xlabel(label_string)
>       title(label_string)
> 
> print_filename = sprintf('./test_gnuplot.png')
> print(print_filename, '-dpng','-FHelvetica:8','-S1024,768')

I recommend you try TeX markup.

        label_string = "123^o C";

or

        label_string = "123^\circ C";

The second version may not display correctly, but should show in the png 
correctly.

Ben



reply via email to

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