|
From: | Walter White |
Subject: | Re: Differences between graphics_toolkits, greek letters |
Date: | Sun, 22 Jan 2012 00:12:58 +0100 |
User-agent: | Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0 |
Am 21.01.2012 15:52, schrieb Ben Abbott:
On Jan 21, 2012, at 5:28 AM, Walter White<address@hidden> wrote:Am 20.01.2012 23:48, schrieb Ben Abbott: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 allThe 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 BenI filed a bug report. https://savannah.gnu.org/bugs/index.php?35330 BenI'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. BenHello, 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. BenThanks Ben, this works fine. I played with tex mode for a while and another question arose. So far I found two different methods to change the fontsize: The one using tex mode and the other one using print. print(print_filename, '-dpng','-FHelvetica:20','-S1280,1024') But I found out that e.g. for xlabels or title that the spacing on the top or the left does not automatically fit the fontsize if tex mode is used. Instead it seems that print's -F parameter does set the spacing to the given font and all other fontsize commands (e.g. tex mode) set the fontsize but will not increase the spacing if the text does not fit to the spacing anymore. Do I interpret the behaviour correctly? Cheers, WalterHow did you change the fontsize using "TeX mode" ? Ben
I used {\fontsize{20}Some text here}. This is what you call "TeX mode", right? I read about an option "interpreter" "tex" in the docs, but I did not set it. Is the Tex-syntax recognized automatically by Octave?
[Prev in Thread] | Current Thread | [Next in Thread] |