Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #1657
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | sfeam <sfeam@users.sourceforge.net> |
| Newsgroups | comp.graphics.apps.gnuplot |
| Subject | Re: Read values from file as input values |
| Followup-To | comp.graphics.apps.gnuplot |
| Date | Tue, 19 Feb 2013 13:02:44 -0800 |
| Organization | gnuplot development team |
| Lines | 29 |
| Message-ID | <kg0p80$9nv$1@dont-email.me> (permalink) |
| References | <6aa41d8a-c89b-4f4d-b2d6-cbd18a39c03f@googlegroups.com> |
| Reply-To | sfeam@users.sourceforge.net |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset="ISO-8859-1" |
| Content-Transfer-Encoding | 7Bit |
| Injection-Date | Tue, 19 Feb 2013 21:01:52 +0000 (UTC) |
| Injection-Info | mx05.eternal-september.org; posting-host="8e86a57dfa599721f116da4577f3d1af"; logging-data="9983"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+N/TJ07m+cxedlrCd1/vnv" |
| User-Agent | KNode/4.4.9 |
| Cancel-Lock | sha1:FX+z0ETxdd9Q75D6OC8NzVIufVM= |
| Xref | csiph.com comp.graphics.apps.gnuplot:1657 |
Followups directed to: comp.graphics.apps.gnuplot
Show key headers only | View raw
riehenringwg@gmail.com wrote:
> Hi
> I often come across the situation in which I want to specify the x,y-axes
> limits depending on the output-txt file that I get from simulations. More
> specifically: It would be very useful if there was a command that simply
> reads values from a .txt or .dat file and these values could be stored in
> variables specified in the gnuplot script (sth like dlmread in Matlab).
> I found a (not very elegant) way to do it anyway: plot the file, extract
> the limits of the axes via the GPVAL command and close the plot and replot
> with the appropriate limits. However, I wonder if there is a more elegant
> way (since here everything has to be plotted twice & a lot of windows open
> and close)? Thx in advance. riehen
Several suggestions come to mind.
1) gnuplot> XRANGE = system("cat xrange.txt")
gnuplot> XMIN = real(word(XRANGE,1))
gnuplot> XMAN = real(word(XRANGE,2))
gnuplot> set xrange [XMIN:XMAX]
2) Have the program that creates the file write an actual gnuplot command,
e.g. have the file contain
set xrange [123:456]
rather than
123 456
gnuplot> load "xrange.txt"
3) gnuplot> stats "simulation.out" using X:Y
gnuplot> set xrange [ stats_min_x : stats_max_x ]
Back to comp.graphics.apps.gnuplot | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Read values from file as input values riehenringwg@gmail.com - 2013-02-19 04:27 -0800
Re: Read values from file as input values sfeam <sfeam@users.sourceforge.net> - 2013-02-19 13:02 -0800
Re: Read values from file as input values riehen <riehenringwg@gmail.com> - 2013-02-20 06:21 -0800
Re: Read values from file as input values riehen <riehenringwg@gmail.com> - 2013-02-20 06:22 -0800
csiph-web