Quantcast

gnuplot settings in Octave

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

gnuplot settings in Octave

Ron Crummett-2
Hello all -

Once upon a time I was able to edit my .Xdefaults file to configure settings for Gnuplot. I could change the default plot window size, the background/axes/plot colors, maybe more. And whatever I had in there worked for Gnuplot in general, whether called from Octave or not.

That was a few years ago; now it seems that my defaults are overridden by Octave. Does that mean I can set my preferences somewhere in Octave?

And what about LaTeX commands in the title? I thought this had been resolved but when I tried to do

title('\pi');

all I got was a 'p' at the top. Is there somewhere to set a default font?

Thanks.

-Ron

_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gnuplot settings in Octave

bpabbott
Administrator

On Nov 2, 2011, at 1:57 AM, Ron Crummett wrote:

> Hello all -
>
> Once upon a time I was able to edit my .Xdefaults file to configure settings for Gnuplot. I could change the default plot window size, the background/axes/plot colors, maybe more. And whatever I had in there worked for Gnuplot in general, whether called from Octave or not.
>
> That was a few years ago; now it seems that my defaults are overridden by Octave. Does that mean I can set my preferences somewhere in Octave?
>
> And what about LaTeX commands in the title? I thought this had been resolved but when I tried to do
>
> title('\pi');
>
> all I got was a 'p' at the top. Is there somewhere to set a default font?
>
> Thanks.
>
> -Ron

You can modify the default figure properties in your ~/.octaverc file.

To see what the figure properties are type ...

        set (gcf)

For the axes ...

        set (gca)

To change the background color of the figure ...

        plot (0:10)
        set (gcf, 'color', 'b')

For the axes ...

        set (gca, 'color', 'r')

It does look like there is a font problem with gnuplot (no Symbol font?). The gnuplot page below may be of some help.

        http://www.gnuplot.info/faq/faq.html#SECTION00091000000000000000

If you are using the x11 terminal (that is the default), then gnuplot uses the x11 font server. If you are using wxt, then gnuplot is using fontconfig. You can try changing your gnuplot terminal to see if that fixes the problem.

Assuming you are using x11, If you want to switch to wxt, then ...

        close all
        setenv ("GNUTERM", "wxt")

However, the best solution is to make sure that your x11 font server and fontconfig both are aware of the fonts you'd like to use.

Ben

_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gnuplot settings in Octave

kloof
In reply to this post by Ron Crummett-2
On Tue, Nov 01, 2011 at 10:57:08PM -0700, Ron Crummett wrote:

> Hello all -
>
> Once upon a time I was able to edit my .Xdefaults file to configure
> settings for Gnuplot. I could change the default plot window size, the
> background/axes/plot colors, maybe more. And whatever I had in there worked
> for Gnuplot in general, whether called from Octave or not.
>
> That was a few years ago; now it seems that my defaults are overridden by
> Octave. Does that mean I can set my preferences somewhere in Octave?
>
> And what about LaTeX commands in the title? I thought this had been
> resolved but when I tried to do
>
> title('\pi');
>
> all I got was a 'p' at the top. Is there somewhere to set a default font?
>
> Thanks.
>
> -Ron

> _______________________________________________
> Help-octave mailing list
> [hidden email]
> https://mailman.cae.wisc.edu/listinfo/help-octave


concerning \pi :
test whether 'tex' is interpreting your text or not. one of the
properties in get(gca()) or get(h) (h is your plot handle) should get
you a property 'interpreter', which you can set to 'tex'. Then it works.


_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gnuplot settings in Octave

Ron Crummett-2
First of all, thanks for the advice. I like this.

Now, for the suggestions:

get(gcf, 'position')

returned [300 200 560 420]. Also, a plot window opened. So I tried to add the following to my .octaverc file:

set(gcf, 'position', [0 0 200 200]);

When I restarted Octave a plot window immediately opened in the lower left-hand corner (0, 0), and based on the size I'm guessing it was 200x200. But when I tried to open a second figure it was at the same location and same size as the default position.

I'd like for all plot windows to be at the location and size I specify, and I'd prefer to not have a plot window open up each time I start Octave. Is there something more that needs to be done with this?

Regarding the TeX interpreter:

get(gca, 'interpreter')

returns 'ans=none'

So it looks as though there is no interpreter. I tried the command

set(gca, 'interpreter', 'tex')

and nothing changed. In fact, running a second time the command

get(gca, 'interpreter')

still returned 'none' for the answer.

I'm guessing that the answers to my two questions are related, but how to get those answers, any and all help is appreciated. Thanks again!

-Ron

On Wed, Nov 2, 2011 at 9:48 AM, indium <[hidden email]> wrote:
On Tue, Nov 01, 2011 at 10:57:08PM -0700, Ron Crummett wrote:
> Hello all -
>
> Once upon a time I was able to edit my .Xdefaults file to configure
> settings for Gnuplot. I could change the default plot window size, the
> background/axes/plot colors, maybe more. And whatever I had in there worked
> for Gnuplot in general, whether called from Octave or not.
>
> That was a few years ago; now it seems that my defaults are overridden by
> Octave. Does that mean I can set my preferences somewhere in Octave?
>
> And what about LaTeX commands in the title? I thought this had been
> resolved but when I tried to do
>
> title('\pi');
>
> all I got was a 'p' at the top. Is there somewhere to set a default font?
>
> Thanks.
>
> -Ron

> _______________________________________________
> Help-octave mailing list
> [hidden email]
> https://mailman.cae.wisc.edu/listinfo/help-octave


concerning \pi :
test whether 'tex' is interpreting your text or not. one of the
properties in get(gca()) or get(h) (h is your plot handle) should get
you a property 'interpreter', which you can set to 'tex'. Then it works.




_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gnuplot settings in Octave

bpabbott
Administrator

On Nov 3, 2011, at 2:32 AM, Ron Crummett wrote:

> First of all, thanks for the advice. I like this.
>
> Now, for the suggestions:
>
> get(gcf, 'position')
>
> returned [300 200 560 420]. Also, a plot window opened. So I tried to add the following to my .octaverc file:
>
> set(gcf, 'position', [0 0 200 200]);
>
> When I restarted Octave a plot window immediately opened in the lower left-hand corner (0, 0), and based on the size I'm guessing it was 200x200. But when I tried to open a second figure it was at the same location and same size as the default position.
>
> I'd like for all plot windows to be at the location and size I specify, and I'd prefer to not have a plot window open up each time I start Octave. Is there something more that needs to be done with this?
>
> Regarding the TeX interpreter:
>
> get(gca, 'interpreter')
>
> returns 'ans=none'
>
> So it looks as though there is no interpreter. I tried the command
>
> set(gca, 'interpreter', 'tex')
>
> and nothing changed. In fact, running a second time the command
>
> get(gca, 'interpreter')
>
> still returned 'none' for the answer.
>
> I'm guessing that the answers to my two questions are related, but how to get those answers, any and all help is appreciated. Thanks again!
>
> -Ron

To change the default figure position you'll need to modify the root.

        set (0, "defaultfigureposition", [0 0 200 200])

If you set the "position" property for the current figure, it will only effect that single figure ... after it creates the figure.

My .octaverc includes the lines below. They each produce the desired effect.

   set (0, "defaultaxesfontname", "Helvetica")
   set (0, "defaulttextfontname", "Helvetica")
   set (0, "defaultaxesfontsize", 12)
   set (0, "defaulttextfontsize", 12)
   set (0, "defaultaxesinterpreter", "tex")
   set (0, "defaultfigurepapertype", "usletter")
   set (0, "defaultfigureposition", [440 280 560 420])

Ben

_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gnuplot settings in Octave

Ron Crummett-2
Okay, this is great. I've managed to get the plot window to the size I want. What other properties can I set like this?

I'm still having problems with the TeX interpreter; I wonder if it may be a font issue. When I try to annotate a plot I see everything displayed in the "default" gnuplot font, although I've tried to change it to something else. And no symbols when I wanted them.

When I tried to print the figure (save it as jpeg), I got the following error multiple times (one for each text string, I believe):

gdImageStringFT: Could not find/open font while printing string <string> with font <font>

Any idea what this is about, and what I need to do to fix it?

Thanks again!

-Ron

On Thu, Nov 3, 2011 at 5:47 AM, Ben Abbott <[hidden email]> wrote:

On Nov 3, 2011, at 2:32 AM, Ron Crummett wrote:

> First of all, thanks for the advice. I like this.
>
> Now, for the suggestions:
>
> get(gcf, 'position')
>
> returned [300 200 560 420]. Also, a plot window opened. So I tried to add the following to my .octaverc file:
>
> set(gcf, 'position', [0 0 200 200]);
>
> When I restarted Octave a plot window immediately opened in the lower left-hand corner (0, 0), and based on the size I'm guessing it was 200x200. But when I tried to open a second figure it was at the same location and same size as the default position.
>
> I'd like for all plot windows to be at the location and size I specify, and I'd prefer to not have a plot window open up each time I start Octave. Is there something more that needs to be done with this?
>
> Regarding the TeX interpreter:
>
> get(gca, 'interpreter')
>
> returns 'ans=none'
>
> So it looks as though there is no interpreter. I tried the command
>
> set(gca, 'interpreter', 'tex')
>
> and nothing changed. In fact, running a second time the command
>
> get(gca, 'interpreter')
>
> still returned 'none' for the answer.
>
> I'm guessing that the answers to my two questions are related, but how to get those answers, any and all help is appreciated. Thanks again!
>
> -Ron

To change the default figure position you'll need to modify the root.

       set (0, "defaultfigureposition", [0 0 200 200])

If you set the "position" property for the current figure, it will only effect that single figure ... after it creates the figure.

My .octaverc includes the lines below. They each produce the desired effect.

  set (0, "defaultaxesfontname", "Helvetica")
  set (0, "defaulttextfontname", "Helvetica")
  set (0, "defaultaxesfontsize", 12)
  set (0, "defaulttextfontsize", 12)
  set (0, "defaultaxesinterpreter", "tex")
  set (0, "defaultfigurepapertype", "usletter")
  set (0, "defaultfigureposition", [440 280 560 420])

Ben



_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gnuplot settings in Octave

bpabbott
Administrator

On Nov 4, 2011, at 2:33 AM, Ron Crummett wrote:

> On Thu, Nov 3, 2011 at 5:47 AM, Ben Abbott <[hidden email]> wrote:
>
>> On Nov 3, 2011, at 2:32 AM, Ron Crummett wrote:
>>
>> > First of all, thanks for the advice. I like this.
>> >
>> > Now, for the suggestions:
>> >
>> > get(gcf, 'position')
>> >
>> > returned [300 200 560 420]. Also, a plot window opened. So I tried to add the following to my .octaverc file:
>> >
>> > set(gcf, 'position', [0 0 200 200]);
>> >
>> > When I restarted Octave a plot window immediately opened in the lower left-hand corner (0, 0), and based on the size I'm guessing it was 200x200. But when I tried to open a second figure it was at the same location and same size as the default position.
>> >
>> > I'd like for all plot windows to be at the location and size I specify, and I'd prefer to not have a plot window open up each time I start Octave. Is there something more that needs to be done with this?
>> >
>> > Regarding the TeX interpreter:
>> >
>> > get(gca, 'interpreter')
>> >
>> > returns 'ans=none'
>> >
>> > So it looks as though there is no interpreter. I tried the command
>> >
>> > set(gca, 'interpreter', 'tex')
>> >
>> > and nothing changed. In fact, running a second time the command
>> >
>> > get(gca, 'interpreter')
>> >
>> > still returned 'none' for the answer.
>> >
>> > I'm guessing that the answers to my two questions are related, but how to get those answers, any and all help is appreciated. Thanks again!
>> >
>> > -Ron
>>
>> To change the default figure position you'll need to modify the root.
>>
>>        set (0, "defaultfigureposition", [0 0 200 200])
>>
>> If you set the "position" property for the current figure, it will only effect that single figure ... after it creates the figure.
>>
>> My .octaverc includes the lines below. They each produce the desired effect.
>>
>>   set (0, "defaultaxesfontname", "Helvetica")
>>   set (0, "defaulttextfontname", "Helvetica")
>>   set (0, "defaultaxesfontsize", 12)
>>   set (0, "defaulttextfontsize", 12)
>>   set (0, "defaultaxesinterpreter", "tex")
>>   set (0, "defaultfigurepapertype", "usletter")
>>   set (0, "defaultfigureposition", [440 280 560 420])
>>
>> Ben
>
> Okay, this is great. I've managed to get the plot window to the size I want. What other properties can I set like this?
>
> I'm still having problems with the TeX interpreter; I wonder if it may be a font issue. When I try to annotate a plot I see everything displayed in the "default" gnuplot font, although I've tried to change it to something else. And no symbols when I wanted them.
>
> When I tried to print the figure (save it as jpeg), I got the following error multiple times (one for each text string, I believe):
>
> gdImageStringFT: Could not find/open font while printing string <string> with font <font>
>
> Any idea what this is about, and what I need to do to fix it?
>
> Thanks again!
>
> -Ron

To see all the properties you can set for figures ...

        set (gcf)

To see all the properties for axes ...

        set (gca)

I assume you're using x11? Gnuplot uses the x11 font system for displaying fonts, and uses fontconfig for output, such as jpeg.

I'm not very knowledgeable about the details of font management. However, there is a short description in the gnuplot faq.

        http://www.gnuplot.info/faq/faq.html#SECTION00091000000000000000

Ben


_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Loading...