plot titles are off of the plot

View: New views
12 Messages — Rating Filter:   Alert me  

plot titles are off of the plot

by charles reid :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi -

I'm using Octave 3.2.0 on a Mac.  When I create plots, the titles are not entirely in the plot window (see attached "Picture 1.png").  I've tried re-adjusting the physical position of the titles, but it doesn't fix the problem (the text is still cut off, or I have to make it overlap with the plot itself).  I see this behavior using GnuPlot with either X11 or Aquaterm as my back-end.  The behavior is really annoying, since, to see the actual plot titles, I have to save the plot to an external file, which looks fine (see attached "Picture 2.png").  Does anybody have any idea what is causing this?  Is anyone else experiencing this problem?


Charles



_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Picture 1.png (63K) Download Attachment
Picture 2.png (16K) Download Attachment

Parent Message unknown Re: plot titles are off of the plot

by mbrennwa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Oct 23, 2009, at 2:29 PM, help-octave-request@... wrote:

> Hi -
>
> I'm using Octave 3.2.0 on a Mac.  When I create plots, the titles  
> are not
> entirely in the plot window (see attached "Picture 1.png").  I've  
> tried
> re-adjusting the physical position of the titles, but it doesn't fix  
> the
> problem (the text is still cut off, or I have to make it overlap  
> with the
> plot itself).  I see this behavior using GnuPlot with either X11 or  
> Aquaterm
> as my back-end.  The behavior is really annoying, since, to see the  
> actual
> plot titles, I have to save the plot to an external file, which  
> looks fine
> (see attached "Picture 2.png").  Does anybody have any idea what is  
> causing
> this?  Is anyone else experiencing this problem?

Hi Charles

How did you create the PNG file? I believe your problem might be  
related to this:

http://www.nabble.com/Axis-labels-in-EPS-figure-are-outside-bounding-box-td25941582.html#a25942083

Matthias
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: plot titles are off of the plot

by Stuart Edwards :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

yes, I get this problem with 3.2 on 10.5 all the time.  Since I always  
export an svg to Inkscape for presentation it hasn't been a problem -  
but it is a minor nuisance.

Stu


On Oct 23, 2009, at 1:14 AM, charles reid wrote:

> Hi -
>
> I'm using Octave 3.2.0 on a Mac.  When I create plots, the titles  
> are not entirely in the plot window (see attached "Picture 1.png").  
> I've tried re-adjusting the physical position of the titles, but it  
> doesn't fix the problem (the text is still cut off, or I have to  
> make it overlap with the plot itself).  I see this behavior using  
> GnuPlot with either X11 or Aquaterm as my back-end.  The behavior is  
> really annoying, since, to see the actual plot titles, I have to  
> save the plot to an external file, which looks fine (see attached  
> "Picture 2.png").  Does anybody have any idea what is causing this?  
> Is anyone else experiencing this problem?
>
>
> Charles
> <Picture 1.png><Picture  
> 2.png>_______________________________________________
> Help-octave mailing list
> Help-octave@...
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: plot titles are off of the plot

by charles reid :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes, I'm generating these plots using the 'plot' command.  Is there another graphics back-end that won't have this problem?


On Fri, Oct 23, 2009 at 06:52, Matthias Brennwald <matthias@...> wrote:

On Oct 23, 2009, at 2:29 PM, help-octave-request@... wrote:

Hi -

I'm using Octave 3.2.0 on a Mac.  When I create plots, the titles are not
entirely in the plot window (see attached "Picture 1.png").  I've tried
re-adjusting the physical position of the titles, but it doesn't fix the
problem (the text is still cut off, or I have to make it overlap with the
plot itself).  I see this behavior using GnuPlot with either X11 or Aquaterm
as my back-end.  The behavior is really annoying, since, to see the actual
plot titles, I have to save the plot to an external file, which looks fine
(see attached "Picture 2.png").  Does anybody have any idea what is causing
this?  Is anyone else experiencing this problem?

Hi Charles

How did you create the PNG file? I believe your problem might be related to this:

http://www.nabble.com/Axis-labels-in-EPS-figure-are-outside-bounding-box-td25941582.html#a25942083

Matthias


_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: plot titles are off of the plot

by Ben Abbott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Oct 23, 2009, at 1:40 PM, charles reid wrote:

> On Fri, Oct 23, 2009 at 06:52, Matthias Brennwald <matthias@...
> > wrote:
>
>> On Oct 23, 2009, at 2:29 PM, help-octave-request@... wrote:
>>
>>> Hi -
>>>
>>> I'm using Octave 3.2.0 on a Mac.  When I create plots, the titles  
>>> are not
>>> entirely in the plot window (see attached "Picture 1.png").  I've  
>>> tried
>>> re-adjusting the physical position of the titles, but it doesn't  
>>> fix the
>>> problem (the text is still cut off, or I have to make it overlap  
>>> with the
>>> plot itself).  I see this behavior using GnuPlot with either X11  
>>> or Aquaterm
>>> as my back-end.  The behavior is really annoying, since, to see  
>>> the actual
>>> plot titles, I have to save the plot to an external file, which  
>>> looks fine
>>> (see attached "Picture 2.png").  Does anybody have any idea what  
>>> is causing
>>> this?  Is anyone else experiencing this problem?
>>
>> Hi Charles
>>
>> How did you create the PNG file? I believe your problem might be  
>> related to this:
>>
>> http://www.nabble.com/Axis-labels-in-EPS-figure-are-outside-bounding-box-td25941582.html#a25942083
>>
>> Matthias
>>
> Yes, I'm generating these plots using the 'plot' command.  Is there  
> another graphics back-end that won't have this problem?

If you make an adjustment to the "position" property, you'll be able  
to compensate for this *feature* of the gnuplot backend. The  
developers are currentl working on a new backend, but printing is not  
yet supported.

To compensate, try ...

        set (gca, "position", [0.26   0.22  0.645   0.705])

... and then try your print command again.

Ben
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Parent Message unknown Re: plot titles are off of the plot

by charles reid :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

To clarify:
- The title is off the plot when I make a plot (whether it's a contour plot, a surface plot, a stem plot, a plain plot, etc.).  The title is always off of the plot so that I can only see the bottom portion of the words. (this was the screenshot, attachment Picture 1.png)
- When I use the 'saveas' command to save the plot to a file, everything looks fine. (this was the attachment Picture 2.png)

So the problem isn't with the saved figure, it's with the plots that are created and shown to me on the screen.  Thus, if I want to see the title of a plot, I have to save it using the 'saveas' command and open the picture file.


Charles

On Sat, Oct 24, 2009 at 01:25, Matthias Brennwald <matthias@...> wrote:
2009/10/23 charles reid <charlesreid1@...>
Yes, I'm generating these plots using the 'plot' command.  Is there another graphics back-end that won't have this problem?


On Fri, Oct 23, 2009 at 06:52, Matthias Brennwald <matthias@...> wrote:

On Oct 23, 2009, at 2:29 PM, help-octave-request@... wrote:

Hi -

I'm using Octave 3.2.0 on a Mac.  When I create plots, the titles are not
entirely in the plot window (see attached "Picture 1.png").  I've tried
re-adjusting the physical position of the titles, but it doesn't fix the
problem (the text is still cut off, or I have to make it overlap with the
plot itself).  I see this behavior using GnuPlot with either X11 or Aquaterm
as my back-end.  The behavior is really annoying, since, to see the actual
plot titles, I have to save the plot to an external file, which looks fine
(see attached "Picture 2.png").  Does anybody have any idea what is causing
this?  Is anyone else experiencing this problem?

Hi Charles

How did you create the PNG file? I believe your problem might be related to this:

http://www.nabble.com/Axis-labels-in-EPS-figure-are-outside-bounding-box-td25941582.html#a25942083

Matthias

My question was not if you use the plot command (I can't think of an alternative), but if you use the print command to save the plot to a file. As demonstrated in the thread linked above, saving figures to files may not always result in proper "bounding boxes", i.e. the stuff in the figure might lie outside the figure boundaries in the saved file. My last message in the mentioned thread illustrates how to get around this issue (which might also be useful to adjust the "bounding boxes" for figures displayed on screen). Yet, I am not sure if this is really what is causing your problem.

Matthias


_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: plot titles are off of the plot

by charles reid :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Ben -

Thanks for the 'set' suggestion, but it doesn't work - it's moving the plot itself, not the title.  I tried putting the command right before and right after the title command, and putting it at the end of all the commands related to the plot, but they all give the same result - the plot, not the title, is shifted.


Charles

On Fri, Oct 23, 2009 at 17:46, Ben Abbott <bpabbott@...> wrote:

On Oct 23, 2009, at 1:40 PM, charles reid wrote:

On Fri, Oct 23, 2009 at 06:52, Matthias Brennwald <matthias@...> wrote:

On Oct 23, 2009, at 2:29 PM, help-octave-request@... wrote:

Hi -

I'm using Octave 3.2.0 on a Mac.  When I create plots, the titles are not
entirely in the plot window (see attached "Picture 1.png").  I've tried
re-adjusting the physical position of the titles, but it doesn't fix the
problem (the text is still cut off, or I have to make it overlap with the
plot itself).  I see this behavior using GnuPlot with either X11 or Aquaterm
as my back-end.  The behavior is really annoying, since, to see the actual
plot titles, I have to save the plot to an external file, which looks fine
(see attached "Picture 2.png").  Does anybody have any idea what is causing
this?  Is anyone else experiencing this problem?

Hi Charles

How did you create the PNG file? I believe your problem might be related to this:

http://www.nabble.com/Axis-labels-in-EPS-figure-are-outside-bounding-box-td25941582.html#a25942083

Matthias

Yes, I'm generating these plots using the 'plot' command.  Is there another graphics back-end that won't have this problem?

If you make an adjustment to the "position" property, you'll be able to compensate for this *feature* of the gnuplot backend. The developers are currentl working on a new backend, but printing is not yet supported.

To compensate, try ...

       set (gca, "position", [0.26   0.22  0.645   0.705])

... and then try your print command again.

Ben


_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: plot titles are off of the plot

by Ben Abbott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Oct 24, 2009, at 4:19 PM, charles reid wrote:

> On Fri, Oct 23, 2009 at 17:46, Ben Abbott <bpabbott@...> wrote:
>
>> On Oct 23, 2009, at 1:40 PM, charles reid wrote:
>>
>>> On Fri, Oct 23, 2009 at 06:52, Matthias Brennwald <matthias@...
>>> > wrote:
>>>
>>>> On Oct 23, 2009, at 2:29 PM, help-octave-request@... wrote:
>>>>
>>>>> Hi -
>>>>>
>>>>> I'm using Octave 3.2.0 on a Mac.  When I create plots, the  
>>>>> titles are not
>>>>> entirely in the plot window (see attached "Picture 1.png").  
>>>>> I've tried
>>>>> re-adjusting the physical position of the titles, but it doesn't  
>>>>> fix the
>>>>> problem (the text is still cut off, or I have to make it overlap  
>>>>> with the
>>>>> plot itself).  I see this behavior using GnuPlot with either X11  
>>>>> or Aquaterm
>>>>> as my back-end.  The behavior is really annoying, since, to see  
>>>>> the actual
>>>>> plot titles, I have to save the plot to an external file, which  
>>>>> looks fine
>>>>> (see attached "Picture 2.png").  Does anybody have any idea what  
>>>>> is causing
>>>>> this?  Is anyone else experiencing this problem?
>>>>>
>>>> Hi Charles
>>>>
>>>> How did you create the PNG file? I believe your problem might be  
>>>> related to this:
>>>>
>>>> http://www.nabble.com/Axis-labels-in-EPS-figure-are-outside-bounding-box-td25941582.html#a25942083
>>>>
>>>> Matthias
>>>
>>> Yes, I'm generating these plots using the 'plot' command.  Is  
>>> there another graphics back-end that won't have this problem?
>>>
>>> If you make an adjustment to the "position" property, you'll be  
>>> able to compensate for this *feature* of the gnuplot backend. The  
>>> developers are currentl working on a new backend, but printing is  
>>> not yet supported.
>>
>> To compensate, try ...
>>
>>        set (gca, "position", [0.26   0.22  0.645   0.705])
>>
>> ... and then try your print command again.
>>
>> Ben
>>
>
> Hi Ben -
>
> Thanks for the 'set' suggestion, but it doesn't work - it's moving  
> the plot itself, not the title.  I tried putting the command right  
> before and right after the title command, and putting it at the end  
> of all the commands related to the plot, but they all give the same  
> result - the plot, not the title, is shifted.
>
> Charles

Please try one more time ...

        close all
        figure (1)
        plot (1:10)
        xlabel ("xlabel")
        ylabel ("ylabel")
        title ("title")
        print -dpng test1.png
        p = get (gca, "position");
        p(4) = p(4) - p(2);
        set (gca, "position", p)
        print -dpng test2.png

... and then email each png to me so that I can compare with what I see.

Also, please let us know how you obtained your octave from Fink,  
MacPorts, or Sourceforge.

Thanks
Ben



_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: plot titles are off of the plot

by Ben Abbott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Oct 24, 2009, at 6:09 PM, Ben Abbott wrote:

> On Oct 24, 2009, at 4:19 PM, charles reid wrote:
>
>> On Fri, Oct 23, 2009 at 17:46, Ben Abbott <bpabbott@...> wrote:
>>
>>> On Oct 23, 2009, at 1:40 PM, charles reid wrote:
>>>
>>>> On Fri, Oct 23, 2009 at 06:52, Matthias Brennwald <matthias@...
>>>>> wrote:
>>>>
>>>>> On Oct 23, 2009, at 2:29 PM, help-octave-request@... wrote:
>>>>>
>>>>>> Hi -
>>>>>>
>>>>>> I'm using Octave 3.2.0 on a Mac.  When I create plots, the
>>>>>> titles are not
>>>>>> entirely in the plot window (see attached "Picture 1.png").
>>>>>> I've tried
>>>>>> re-adjusting the physical position of the titles, but it doesn't
>>>>>> fix the
>>>>>> problem (the text is still cut off, or I have to make it overlap
>>>>>> with the
>>>>>> plot itself).  I see this behavior using GnuPlot with either X11
>>>>>> or Aquaterm
>>>>>> as my back-end.  The behavior is really annoying, since, to see
>>>>>> the actual
>>>>>> plot titles, I have to save the plot to an external file, which
>>>>>> looks fine
>>>>>> (see attached "Picture 2.png").  Does anybody have any idea what
>>>>>> is causing
>>>>>> this?  Is anyone else experiencing this problem?
>>>>>>
>>>>> Hi Charles
>>>>>
>>>>> How did you create the PNG file? I believe your problem might be
>>>>> related to this:
>>>>>
>>>>> http://www.nabble.com/Axis-labels-in-EPS-figure-are-outside-bounding-box-td25941582.html#a25942083
>>>>>
>>>>> Matthias
>>>>
>>>> Yes, I'm generating these plots using the 'plot' command.  Is
>>>> there another graphics back-end that won't have this problem?
>>>>
>>>> If you make an adjustment to the "position" property, you'll be
>>>> able to compensate for this *feature* of the gnuplot backend. The
>>>> developers are currentl working on a new backend, but printing is
>>>> not yet supported.
>>>
>>> To compensate, try ...
>>>
>>>       set (gca, "position", [0.26   0.22  0.645   0.705])
>>>
>>> ... and then try your print command again.
>>>
>>> Ben
>>
>> Hi Ben -
>>
>> Thanks for the 'set' suggestion, but it doesn't work - it's moving
>> the plot itself, not the title.  I tried putting the command right
>> before and right after the title command, and putting it at the end
>> of all the commands related to the plot, but they all give the same
>> result - the plot, not the title, is shifted.
>>
>> Charles
>
> Please try one more time ...
>
> close all
> figure (1)
> plot (1:10)
> xlabel ("xlabel")
> ylabel ("ylabel")
> title ("title")
> print -dpng test1.png
> p = get (gca, "position");
> p(4) = p(4) - p(2);
> set (gca, "position", p)
> print -dpng test2.png
>
> ... and then email each png to me so that I can compare with what I  
> see.
>
> Also, please let us know how you obtained your octave from Fink,
> MacPorts, or Sourceforge.
>
> Thanks
> Ben
I'm now attaching what I see as a follow up since attaching files  
often delays them being posted to the list.

Ben






_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

test1.png (33K) Download Attachment
test2.png (31K) Download Attachment

Re: plot titles are off of the plot

by charles reid :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Ben -

The plots I get are the same (both at http://charles.endoftheinternet.org/test1.png and http://charles.endoftheinternet.org/test2.png)

This solution solves my problem!  Thanks for your help.  (Also, in case it is still of interest, I am using a binary from SourceForge).


Charles

On Sat, Oct 24, 2009 at 16:12, Ben Abbott <bpabbott@...> wrote:

On Oct 24, 2009, at 6:09 PM, Ben Abbott wrote:

On Oct 24, 2009, at 4:19 PM, charles reid wrote:

On Fri, Oct 23, 2009 at 17:46, Ben Abbott <bpabbott@...> wrote:

On Oct 23, 2009, at 1:40 PM, charles reid wrote:

On Fri, Oct 23, 2009 at 06:52, Matthias Brennwald <matthias@...
wrote:

On Oct 23, 2009, at 2:29 PM, help-octave-request@... wrote:

Hi -

I'm using Octave 3.2.0 on a Mac.  When I create plots, the
titles are not
entirely in the plot window (see attached "Picture 1.png").
I've tried
re-adjusting the physical position of the titles, but it doesn't
fix the
problem (the text is still cut off, or I have to make it overlap
with the
plot itself).  I see this behavior using GnuPlot with either X11
or Aquaterm
as my back-end.  The behavior is really annoying, since, to see
the actual
plot titles, I have to save the plot to an external file, which
looks fine
(see attached "Picture 2.png").  Does anybody have any idea what
is causing
this?  Is anyone else experiencing this problem?

Hi Charles

How did you create the PNG file? I believe your problem might be
related to this:

http://www.nabble.com/Axis-labels-in-EPS-figure-are-outside-bounding-box-td25941582.html#a25942083

Matthias

Yes, I'm generating these plots using the 'plot' command.  Is
there another graphics back-end that won't have this problem?

If you make an adjustment to the "position" property, you'll be
able to compensate for this *feature* of the gnuplot backend. The
developers are currentl working on a new backend, but printing is
not yet supported.

To compensate, try ...

     set (gca, "position", [0.26   0.22  0.645   0.705])

... and then try your print command again.

Ben

Hi Ben -

Thanks for the 'set' suggestion, but it doesn't work - it's moving
the plot itself, not the title.  I tried putting the command right
before and right after the title command, and putting it at the end
of all the commands related to the plot, but they all give the same
result - the plot, not the title, is shifted.

Charles

Please try one more time ...

       close all
       figure (1)
       plot (1:10)
       xlabel ("xlabel")
       ylabel ("ylabel")
       title ("title")
       print -dpng test1.png
       p = get (gca, "position");
       p(4) = p(4) - p(2);
       set (gca, "position", p)
       print -dpng test2.png

... and then email each png to me so that I can compare with what I see.

Also, please let us know how you obtained your octave from Fink,
MacPorts, or Sourceforge.

Thanks
Ben

I'm now attaching what I see as a follow up since attaching files often delays them being posted to the list.

Ben






_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: plot titles are off of the plot

by Stuart Edwards :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

apologies for jumping in....

In my case both the title and the xlabel are not displayed in Aquaterm.
There is nothing wrong with the files that are created -- in both your tests I generate the same files that you get and both open with proper title and labels, although Test1 is better presentation - less white space at the top.  However running your procedure does bring the title into view on Aquaterm during Test2 - do you have a suggestion for bringing the xlabel into view?

thx

Stu

10.6.1 / 3.2.2/ Sourceforge

___________ 
On Oct 24, 2009, at 7:35 PM, charles reid wrote:

Hi Ben -

The plots I get are the same (both at http://charles.endoftheinternet.org/test1.png and http://charles.endoftheinternet.org/test2.png)

This solution solves my problem!  Thanks for your help.  (Also, in case it is still of interest, I am using a binary from SourceForge).


Charles

On Sat, Oct 24, 2009 at 16:12, Ben Abbott <bpabbott@...> wrote:

On Oct 24, 2009, at 6:09 PM, Ben Abbott wrote:

On Oct 24, 2009, at 4:19 PM, charles reid wrote:

On Fri, Oct 23, 2009 at 17:46, Ben Abbott <bpabbott@...> wrote:

On Oct 23, 2009, at 1:40 PM, charles reid wrote:

On Fri, Oct 23, 2009 at 06:52, Matthias Brennwald <matthias@...
wrote:

On Oct 23, 2009, at 2:29 PM, help-octave-request@... wrote:

Hi -

I'm using Octave 3.2.0 on a Mac.  When I create plots, the
titles are not
entirely in the plot window (see attached "Picture 1.png").
I've tried
re-adjusting the physical position of the titles, but it doesn't
fix the
problem (the text is still cut off, or I have to make it overlap
with the
plot itself).  I see this behavior using GnuPlot with either X11
or Aquaterm
as my back-end.  The behavior is really annoying, since, to see
the actual
plot titles, I have to save the plot to an external file, which
looks fine
(see attached "Picture 2.png").  Does anybody have any idea what
is causing
this?  Is anyone else experiencing this problem?

Hi Charles

How did you create the PNG file? I believe your problem might be
related to this:

http://www.nabble.com/Axis-labels-in-EPS-figure-are-outside-bounding-box-td25941582.html#a25942083

Matthias

Yes, I'm generating these plots using the 'plot' command.  Is
there another graphics back-end that won't have this problem?

If you make an adjustment to the "position" property, you'll be
able to compensate for this *feature* of the gnuplot backend. The
developers are currentl working on a new backend, but printing is
not yet supported.

To compensate, try ...

     set (gca, "position", [0.26   0.22  0.645   0.705])

... and then try your print command again.

Ben

Hi Ben -

Thanks for the 'set' suggestion, but it doesn't work - it's moving
the plot itself, not the title.  I tried putting the command right
before and right after the title command, and putting it at the end
of all the commands related to the plot, but they all give the same
result - the plot, not the title, is shifted.

Charles

Please try one more time ...

       close all
       figure (1)
       plot (1:10)
       xlabel ("xlabel")
       ylabel ("ylabel")
       title ("title")
       print -dpng test1.png
       p = get (gca, "position");
       p(4) = p(4) - p(2);
       set (gca, "position", p)
       print -dpng test2.png

... and then email each png to me so that I can compare with what I see.

Also, please let us know how you obtained your octave from Fink,
MacPorts, or Sourceforge.

Thanks
Ben

I'm now attaching what I see as a follow up since attaching files often delays them being posted to the list.

Ben





_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave


_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: plot titles are off of the plot

by Ben Abbott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Oct 25, 2009, at 10:32 AM, Stuart Edwards wrote:

> On Oct 24, 2009, at 7:35 PM, charles reid wrote:
>
>> Hi Ben -
>>
>> The plots I get are the same (both at http://charles.endoftheinternet.org/test1.png 
>>  and http://charles.endoftheinternet.org/test2.png)
>>
>> This solution solves my problem!  Thanks for your help.  (Also, in  
>> case it is still of interest, I am using a binary from SourceForge).
>>
>>
>> Charles
>>
>> On Sat, Oct 24, 2009 at 16:12, Ben Abbott <bpabbott@...> wrote:
>>
>> On Oct 24, 2009, at 6:09 PM, Ben Abbott wrote:
>>
>> On Oct 24, 2009, at 4:19 PM, charles reid wrote:
>>
>> On Fri, Oct 23, 2009 at 17:46, Ben Abbott <bpabbott@...> wrote:
>>
>> On Oct 23, 2009, at 1:40 PM, charles reid wrote:
>>
>> On Fri, Oct 23, 2009 at 06:52, Matthias Brennwald <matthias@...
>> wrote:
>>
>> On Oct 23, 2009, at 2:29 PM, help-octave-request@... wrote:
>>
>> Hi -
>>
>> I'm using Octave 3.2.0 on a Mac.  When I create plots, the
>> titles are not
>> entirely in the plot window (see attached "Picture 1.png").
>> I've tried
>> re-adjusting the physical position of the titles, but it doesn't
>> fix the
>> problem (the text is still cut off, or I have to make it overlap
>> with the
>> plot itself).  I see this behavior using GnuPlot with either X11
>> or Aquaterm
>> as my back-end.  The behavior is really annoying, since, to see
>> the actual
>> plot titles, I have to save the plot to an external file, which
>> looks fine
>> (see attached "Picture 2.png").  Does anybody have any idea what
>> is causing
>> this?  Is anyone else experiencing this problem?
>>
>> Hi Charles
>>
>> How did you create the PNG file? I believe your problem might be
>> related to this:
>>
>> http://www.nabble.com/Axis-labels-in-EPS-figure-are-outside-bounding-box-td25941582.html#a25942083
>>
>> Matthias
>>
>> Yes, I'm generating these plots using the 'plot' command.  Is
>> there another graphics back-end that won't have this problem?
>>
>> If you make an adjustment to the "position" property, you'll be
>> able to compensate for this *feature* of the gnuplot backend. The
>> developers are currentl working on a new backend, but printing is
>> not yet supported.
>>
>> To compensate, try ...
>>
>>      set (gca, "position", [0.26   0.22  0.645   0.705])
>>
>> ... and then try your print command again.
>>
>> Ben
>>
>> Hi Ben -
>>
>> Thanks for the 'set' suggestion, but it doesn't work - it's moving
>> the plot itself, not the title.  I tried putting the command right
>> before and right after the title command, and putting it at the end
>> of all the commands related to the plot, but they all give the same
>> result - the plot, not the title, is shifted.
>>
>> Charles
>>
>> Please try one more time ...
>>
>>        close all
>>        figure (1)
>>        plot (1:10)
>>        xlabel ("xlabel")
>>        ylabel ("ylabel")
>>        title ("title")
>>        print -dpng test1.png
>>        p = get (gca, "position");
>>        p(4) = p(4) - p(2);
>>        set (gca, "position", p)
>>        print -dpng test2.png
>>
>> ... and then email each png to me so that I can compare with what I  
>> see.
>>
>> Also, please let us know how you obtained your octave from Fink,
>> MacPorts, or Sourceforge.
>>
>> Thanks
>> Ben
>>
>> I'm now attaching what I see as a follow up since attaching files  
>> often delays them being posted to the list.
>>
>> Ben
> apologies for jumping in....
>
> In my case both the title and the xlabel are not displayed in  
> Aquaterm.
> There is nothing wrong with the files that are created -- in both  
> your tests I generate the same files that you get and both open with  
> proper title and labels, although Test1 is better presentation -  
> less white space at the top.  However running your procedure does  
> bring the title into view on Aquaterm during Test2 - do you have a  
> suggestion for bringing the xlabel into view?
>
> thx
>
> Stu
>
> 10.6.1 / 3.2.2/ Sourceforge

The same approach can be used. The axis position property adjusts the  
lower left corner of the axis within the figure window, as well as the  
width and height of the axis. The position property is a 4 element  
vector. The 1st and 2nd elements are coordinates for the lower left  
corner. The 3rd and 4th elements are the width and height of the axis  
box.  Thus, you can fix this problem by ...

        close all
        figure (1)
        plot (1:10)
        xlabel ("xlabel")
        ylabel ("ylabel")
        title ("title")
        p = get (gca, "position");
        p(3) = p(3)-2*p(1);
        p(4) = p(4)-2*p(2);
        p(1) = 2*p(1);
        p(2) = 2*p(2);
        set (gca, "position", p)

The above produces a rather small axis, so you may want to make some  
adjustments. Once you obtain a result that suits you, you may save the  
setting so that future plots use it as well.

        set (0, "defaultaxesposition", p)

If you want that to stick the next time you run octave, add that  
command to your ~/.octaverc file

        set (0, "defaultaxesposition", [0.26 0.22 0.515 0.595])

Ben

p.s. please respond at the bottom of the email so that the entire  
thread is easier for others to follow. Thanks.


_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave