[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fwd: Re: Controlling Gnuplot from Octave]
From: |
etienne |
Subject: |
[Fwd: Re: Controlling Gnuplot from Octave] |
Date: |
Thu, 14 Jun 2007 08:01:23 -0700 (PDT) |
User-agent: |
SquirrelMail/1.4.9a |
Oops
----------------------------------------------------------------- Original
Message -----------------------------------------------------------------
Subject: Re: Controlling Gnuplot from Octave
From: address@hidden
Date: Wed, June 13, 2007 21:47
To: "John W. Eaton" <address@hidden>
Cc: address@hidden
"tlhiv" <address@hidden>
address@hidden
----------------------------------------------------------------------------------------------------------------------------------------------------
Hi,
this may help:
On Wed, Mar 07, 2007 at 06:26:55PM -0800, address@hidden wrote:
# Hi All,
#
# I developed for my work at Tyzx (.com) a raw octave-gnuplot interface: it
# creates temp dirs, saves data, and allows you to run gnuplot with the
# commands of your choice. If you know how to use gnuplot (and octave), this
# interface may be useful. I have been authorized to distribute it and send
# it in attachment.
#
[snip]
#
# From g_new():
# ============================================================================
# octave:131> help g_new
# g = g_new ( ...) - Create a new gnuplot_object and its directory
#
# The g_XYZ() functions allow Octave to create plots with Gnuplot. They
# are little more than an Octave front-end to Gnuplot, but allow to do
# anything Gnuplot can do directly from Octave. In addition, there are some
# commodity functions (g_cmd() with struct arg, g_locate()) that allow to nest
# one figure in another.
#
# g_new() creates a temporary directory in which data and commands will be
# stored in a gnuplot-readable format.
#
# g_new accepts key, value pairs of arguments, which will be passed to g_set.
#
# Typical usage:
#
# g = g_new (<my options, e.g. on how to display>)
# g = g_data (g, "myChosenDataFileName", data, ...)
# g = g_cmd (g, <gnuplot commands, e.g.>,\
# "plot 'myChosenDataFileName' with lines",...);
# g_plot (g,<options on how to plot, e.g. to file>);
#
# DEMO: Run g_demo(), or see http://gnuplot.sourceforge.net/demo_4.1 on how to
# do nice plots.
#
# SEE ALSO: g_ez, g_delete, g_data, g_cmd, g_plot, g_set, g_locate.
#
# TODO: an OO style of function call (see failed attempt at end of g_new code)
# ==============================================================================
I'll upload the code to http://www.isr.ist.utl.pt/~etienne/g_xyz.tgz.
Unfortunately, it seems to break under gnuplot 4.3, and I do not have time
for fixes or support :-(, so ymmv.
Etienne
On Wed, June 13, 2007 16:36, John W. Eaton wrote:
# On 14-Jun-2007, David Bateman wrote:
#
# | tlhiv wrote:
# | > I have noticed that in recent versions of Octave that gset is now gone.
How
# | > can I control the aspect ratio of my plot? Could someone tell me the way
to
# | > perform this old commands with the new syntax:
# | >
# | > gset size ratio 2/(1+sqrt(5))
# | >
# | > In fact, how would I specify the width/height of an output EPS
# graphic?
#
# That is beyond the scope of Octave graphics at the moment. If you
# need that kind of control, then you will have to do it by writing out
# your data and using some other plotting package. Will gnuplot allow
# you to specify the size of the resulting EPS image directly?
#
# | > In
# | > particular, I want an EPS graphic that is 3 inches wide and as tall as it
# | > needs to be to contain the axis labels, titles, etc. but have the actual
box
# | > that contains the plot have a 2/(1+sqrt(5)) aspect ratio.
# | >
# | > Thanks,
# | >
# | > Troy
# | >
# |
# | What version of Octave are you using? The graphics are entirely
# | different for 2.9.9 and earlier and 2.9.10 and later. If you are using
# | 2.9.9 or earlier then replace gset with __gnuplot_set__, Otherwise in
# | 2.9.10 and later, I believe the only control we currently have over the
# | aspect ratio is axis("square") and family..
#
# The axis command simply controls plot properties. I think the
# dataaspectratio property will do what you want:
#
# x = -10:0.1:10;
# plot (x, sin(x));
# set (gca, 'dataaspectratio', [2/(1+sqrt(5)), 1, 1])
#
# In any case, please use the help list for questions about using
# Octave. The maintainers list is for discussions about the development
# of Octave.
#
# jwe
#
--
http://www.isr.ist.utl.pt/~etienne
--
http://www.isr.ist.utl.pt/~etienne
--
http://www.isr.ist.utl.pt/~etienne
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fwd: Re: Controlling Gnuplot from Octave],
etienne <=