I'm not sure I quite understand your example (your `i` variable is never
used?), but macros just take zero or more expression/symbol arguments and
return expressions, so you could easily do.

macro orangeaxes()
    :(*axes[1][:scatter](kx, real([OnePump.λ1(0., momx, np) for momx in
kx]), s=15, alpha=0.4, color="orange") )*
end
macro axes()
    :(*axes[1][:scatter](kx, real([OnePump.λ2(0., momx, np) for momx in
kx]), s=15, alpha=0.2) )*
end
for i = 1:2
    @orangeaxes
    @axes
    @orangeaxes
    @axes
end

Note the use of the `quote....end` shorthand `:(...)` in the macro
definitions so that an expression is returned.

-Jacob


On Mon, Jul 7, 2014 at 6:04 AM, Andrei Berceanu <[email protected]>
wrote:

> axes[1][:scatter](kx, real([OnePump.λ1(0., momx, np) for momx in kx]),
> s=15, alpha=0.4, color="orange")

Reply via email to