Octave plot on Windows

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Octave plot on Windows

lixo1
Dear all,

I'm using octave 3.2.3, I'm observing that when I plot something like:
x = [-5:0.1:5];
y = sin(x);
plot(x,y);

The gnuplot window is very big, and the gnuplot version is not the wgnuplot (see image).



I would like to get it as default:


So my question: Is there a way to set the default plot as wgnuplot layout? How can I fix the window size?

Thank you very much for any kind of help.
Reply | Threaded
Open this post in threaded view
|

Re: Octave plot on Windows

tmacchant
Hello

This is not problem of gnuplot for windows (windows terminal.)

Plot anything by plot command.

Resize graph windows by mouse.

Click icon on the bar of the graph window.

You can see menu.

Please go Options -> Update C:\Document and .....\wgnuplot.ini

Once the wgnuplot.ini is update, plot can be represented in the size and position recorded at the
update.

You can change it directly to edit C:\Document and .....\wgnuplot.ini by a suitable a text editor.

Regards

Tatsuro

--- lixo1  wrote:

>
> Dear all,
>
> I'm using octave 3.2.3, I'm observing that when I plot something like:
> x = [-5:0.1:5];
> y = sin(x);
> plot(x,y);
>
> The gnuplot window is very big, and the gnuplot version is not the wgnuplot
> (see image).
>
> http://old.nabble.com/file/p27411647/Capture2.png 
>
> I would like to get it as default:
> http://old.nabble.com/file/p27411647/Capture.png 
>
> So my question: Is there a way to set the default plot as wgnuplot layout?
> How can I fix the window size?
>
> Thank you very much for any kind of help.
> --
> View this message in context:
> http://old.nabble.com/Octave-plot-on-Windows-tp27411647p27411647.html
> Sent from the Octave - General mailing list archive at Nabble.com.
>
> _______________________________________________
> Help-octave mailing list
> [hidden email]
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>


--------------------------------------
VANCOUVER 2010 Olympic News [Yahoo! Sports/sportsnavi]
http://pr.mail.yahoo.co.jp/olympic/
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Octave plot on Windows

Benjamin Lindner
In reply to this post by lixo1
>
> Dear all,
>
> I'm using octave 3.2.3, I'm observing that when I plot something like:
> x = [-5:0.1:5];
> y = sin(x);
> plot(x,y);
>
> The gnuplot window is very big, and the gnuplot version is not the
> wgnuplot
> (see image).

This is because octave chooses matlab compatibility and therefore
manually defines the axes' origin and extension which overrides
gnuplot's own positioning algorithms.
Whether this is a wise choice or not can be discussed, but that's
how it is at the moment.

> So my question: Is there a way to set the default plot as wgnuplot layout?

There is a way, but not a straightforward way.

Mind you that this is *not* official, highly dirty, completely
untested, not recommendable, and possibly utterly wrong so use
at your own risk.

That being said you can for example do:

1) disable octave's manual positioning-of-axes altogether by
commenting out lines 61-64 in __go_draw_axes__
( where the "set {lrtb}margin" statements are issued )

or

2) make it somehow flag-able. Without adding a new axes property
you could for example say that if the axes' position is NaN then
octave should not set the position, and do this by enclosing said
lines in __go_draw_axes__ in a if(~isnan(pos)) ... endif statement


Moving to serious discussion again,
Now since the question has been raised, I'd like to follow it up.
Disabling gnuplot's own layout when plotting has also slightly
disturbed me. gnuplot doesn't do such a bad job on this, so
duplicating this into octave doesn't improve it IMO, and currently
*I* need to define the layout when gnuplot could do it for me.
I understand that octave wants to mimick the other side's features,
but in this case it would be nice to be able to disable it.

So how are the chances of getting a feature to disable the manual
positioning octave does.
Thinking about imlpementation, I believe it could be done by adding an
axes property ("positionmode" ?) acting as flag whether to have gnuplot
determine the axes position (kind of an "auto" setting) or if the
position should be calculated by octave (kind of a "manual" setting
or "octave" setting). Then there is of course the possibility that
the user manually really wants to define the axes positions ("user"
setting?).

Or is there already a manual/auto switch for the position like for
the axes x/y/z ranges?

comments?

> How can I fix the window size?

The window size is defined in the wgnuplot.ini file.
There you'll find the entries

GraphOrigin=186 215
GraphSize=499 350

(with differing numbers of course)
designating the position and size of the plot window
for the windows terminal.

benjamin
--
NEU: Mit GMX DSL über 1000,- ¿ sparen!
http://portal.gmx.net/de/go/dsl02
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Octave plot on Windows

lixo1
Thank you very very much for all explanations!!!
Reply | Threaded
Open this post in threaded view
|

Re: Octave plot on Windows

George Barrick
In reply to this post by lixo1

Re: Octave plot on Windows

                          2010.02.02.19:09: UT

Hey GNU-Octave folks,

      I saw the discussion about using the
wgnuplot back-end under Windows.  I have only
the default gnuplot back-end under the
Cygwin 1.7.1 linux emulator for Win32 systems,
and so the wgnuplot option didn't really attract
my attention.

      Further down in that thread, Ben Lindner was
remarking about the need for a function in octave
that disables the gnuplot positioning of axes.
Actually, that kind of thing is now quite easy to
accomplish using the 'graphics handle' capabilities
that have come in with octave >= 3.0.  I realize
that all octave graphics are still supported by
gnuplot calls, but the 'graphics handle' paradigm
that is now available is (for me) extremely useful.

     Attached at the bottom of this post is an
example of octave code that I use to control the
size of my figure window, positioning of the axes
box, axis limits, etc.  With the current octave-3.2.4
I always see a figure window with 4:3 proportions,
but I _can_ control the proportions of the final
file output using the 'print' command formulation
that appears at the end of my file.  I believe
that this kind of thing works also for .eps and
.pdf output files.

     Hopefully, some folks will find this useful.

George                   [hidden email]


<file : plot_pointers.m >
%%  Plotting Window width and height.

winWdt     =  560 ;
winHgt     =  592 ;

win    = [ winWdt winHgt winWdt winHgt ] ;

%%  Parameters for placement of axes.

plotWdt     =   480 ;
plotHgt     =   480 ;
plotXst     =    64 ;
plotYst     =    64 ;

plotPos     =  [ plotXst plotYst plotWdt plotHgt ] ./ win ;

%%  Set limits for the axes.

xlims    = [   0 ,  400 ] ;
ylims    = [   0 ,  400 ] ;

%%  I have carried over the use of graphics handles
%%   from my earlier experience with Matlab.

hdle = figure() ;

%% Spawn axes first, then re-configure them.
kdle = axes() ;
set( kdle,'Position',plotPos ) ;
set( kdle,'XLim',xlims,'YLim',ylims ) ;
set( kdle,'NextPlot','add' ) ;

%% If I want to draw my axes completely different from
%%  the default ones, I just make the axes box invisible
%%  and use other graphing elements to paste stuff in.
%% set( kdle,'NextPlot','add','Visible','off' ) ;

slope = 0.9915                  ;
ntcpt = 0.7300                  ;

tvals = [   0 :  20 : 400 ]     ;
xuns  = ones( size( tvals ) )   ;
yvals = ( slope * tvals ) + ( ntcpt * xuns )    ;

%% Quantile plot from which this example was taken.
%%   The data does not appear in this example, and so
%%   I have commented out the plot.
%% ddle  = plot( escor, pgY, "ko" )        ;

fdle  = plot( tvals, yvals, "k-" )     ;
tdle  = title("Exponential quantile plot for check out data") ;

set(tdle,'FontSize',20) ;

%%  The default plot always seems to be a 4:3
%%   window.  Standard printing size is -r150.

%% The following scales the the output file by
%%  approximately 0.5
%%
%% print -r80 -djpg exptl_quantile.jpg ;

%% Here is how to set the exact proportions for your
%%  output file.
print(hdle,"exptl_quantile.jpg","-djpg","-S560,592");

</file: plot_pointers.m >


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