|
From: <pl...@pi...> - 2012-02-22 12:27:43
|
On 02/22/12 09:37, Christoph Bersch wrote:
> Hi,
>
> On 22.02.2012 08:17, pl...@pi... wrote:
>>
>> I just defined a few macros to shorten some lengthy plot commands, eg.
>>
>> in_lt_blue=' linecol rgb "light-blue" '
>>
>> It worked fine when I loaded the complete file using load command. No
>> errors and I got the right results.
>>
>> Then I tested something else directly at the command prompt:
>>
>> gnuplot> in_red=' linecol rgb "red" '
>> gnuplot> @in_red
>> ^
>> invalid character @
>>
>>
>> I realised that this was in fact correct since I had not ' set macros'
>>
>> But in that case why did it work when I loaded this and similar lines
>> with load ?
>
> could you try to construct a small example which shows this behavior? I
> tried the following to reproduce the error, but it does not show what
> you report:
>
> system('echo "in_red='' linecol rgb \"red\" ''"> test.gp')
> load 'test.gp'
> @in_red
>
> this gives me "invalid character @"
>
> Christoph
Put this in a text file and load it . Change colours to confirm the
macro is being expanded and used.
in_red=' linecol rgb "blue" '
plot sin(x) @in_red
show macros
gnuplot> load "../test.gnu"
command line macros will not be expanded
Peter
|