<^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^>
Mario Rodriguez Riotorto wrote:
> I see two problems here:
> 1. apparently, indices must be greater than zero
> 2. color should be quoted.
> Something like this wouldn't return any error message:
> set xzeroaxis; set style line 1 lc 'black'; set nokey
You are right that this version produces NO error message.
However, the eps file foreground color remains blue (NOT black).
In other words, "set style line 1 lc 'black' " has no effect, including no
error.
> If you wish to give draw2d a try....
> load(draw);
> draw2d(
> color=black, explicit(sin(x),x,0,2*%pi),
> color=blue, explicit(sin(x - 0.2),x,0,2*%pi),
> color=red, explicit(sin(x - 0.4),x,0,2*%pi),
> terminal = eps_color);
This does give me the correct eps file colors,
(also works with terminal = 'eps ).
Dark colors are hard to distinguish with an eps file unless you set the line
width
at something like 10 or larger.
I think the draw package is a major improvement for giving the user much
greater control over each element added to the plot, when that sort of
control is needed.
You have provided us with a great new tool.
The draw package also allows easier setting of "terminal" ( a feature of
interest for
people like me as I write up tutorial/lecture notes (latex/ pdf ) on
teaching and
even doing computational physics with Maxima (really - not totally an
oxymoron),
since it is easier to type:
terminal = 'eps, file_name="c:/work2/myfile",
than to type:
[ gnuplot_term, ps ], [ gnuplot_out_file,
"c:/work2/myfile.eps" ]
(By the way, draw2d(...) sends the eps file to
c:\Documents and Settings\Edwin Woollett\maxima_out.eps
if I leave out the whole file_name element. Is there something I can
define in my maxima-init.mac file so all eps files would go to c:/work2 ?
That way
I could leave out the path part "c:/work2" and just use file_name =
"myfile". )
The draw package also gives me access to a much larger set of colors.
(Is this because I have installed gnuplot 4.2.2 as an independent
application
on my hard drive, or does draw2d(...) behave the same way w/o a separate
gnuplot program ? ie does maxima 5.13 include an up-to-date version of
gnuplot
by default??)
However, I think that the plot2d(...) function is faster to code (if you
don't want separate control over the x-axis-width of each element's drawing)
,
since typing
plot2d( [exp1,exp2,exp3,...], [x, a, b],
[style, [ [lines, 6, 2 ], [lines, 3, 4 ],
[lines, 2, 1 ], ... and etc )
seems easier than
draw2d( line_width=6, color = red, explicit(exp1, x, a, b),
line_width=3, color = "dark-green", explicit(exp2, x, a, b),
line_width=3, color = blue, explicit(exp3, x, a, b), ....
etc ).
If the draw2d (...) function was designed with the same syntax style as
plot2d, the additional
elements of control over each element could be included in several ways.
For example, the "more control mode" over x-axis-width could be employed
by
the user by typing [x, [ [a1,b1], [a2,b2], ...etc ] ], instead of the
more often used form
[x, a, b].
Likewise, the user could be allowed to use either numbers or words for
specifying the color desired,
so [lines, 4, 2], [lines, 4, red ], [lines, 4, "light-salmon'], etc
would be allowed.
( and why not let the typist use [li, 4, 2] instead of [lines, 4, 2]
).
Using a number for line width clearly fits into the plot2d scheme.
<^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^>
<^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^>
Jaime Villate wrote:
> Here is a simple example, which plots sin in blue and co-sine in black:
>
> plot2d([sin(x),cos(x)], [x,0,6], [style,[lines,1,1],[lines,1,4]],
> [gnuplot_term,ps], [gnuplot_out_file,"example.ps"])$
>
I think you are correct that [lines, nw, 4] gives "black" when creating an
eps
file. It is hard for my aging eyes to recognise eps file dark colors unless
I set nw = 10 or even 20, and
that misled me. Thanks.
Ted Woollett
Windows XP
Maxima 5.13a