And we also have a file listing the x-t coordinates of a curve (say,
the x-t coordinates of a particle path or a C+ characteristic). What
is the best way to plot the curve on top of the contour plot? This can
be done by dumping the results extracted by AMRITA simulation into a
program like MATLAB or Mathematica and having those programs do the
plotting, but it may be better to do everything on the fly within
AMRITA
Right now I am thinking of plotting the curve using the "line" command
to connect the points (connecting the first point in the x-t file to
the second point, taking the second point and connecting it to the
third and so on) and overlaying what I get onto the contour plot (of
say pressure gradient). Would this be the right approach to take?
On a related note, is there a way to draw the lines differently, for
example making some lines slightly thicker than other lines, or adding
colour to the lines? Say we wanted to plot many C+ and C-
characteristics together. If we plotted a lot of those lines together,
the result could be a jumbled mess, and we want to colour code it so
that the C+ is red and the C- is blue. Is there a way to do something
like this within AMRITA?
> And we also have a file listing the x-t coordinates of a curve (say,
> the x-t coordinates of a particle path or a C+ characteristic). What
> is the best way to plot the curve on top of the contour plot? This can
> be done by dumping the results extracted by AMRITA simulation into a
> program like MATLAB or Mathematica and having those programs do the
> plotting, but it may be better to do everything on the fly within
> AMRITA
> Right now I am thinking of plotting the curve using the "line" command
> to connect the points (connecting the first point in the x-t file to
> the second point, taking the second point and connecting it to the
> third and so on) and overlaying what I get onto the contour plot (of
> say pressure gradient). Would this be the right approach to take?
> On a related note, is there a way to draw the lines differently, for
> example making some lines slightly thicker than other lines, or adding
> colour to the lines? Say we wanted to plot many C+ and C-
> characteristics together. If we plotted a lot of those lines together,
> the result could be a jumbled mess, and we want to colour code it so
> that the C+ is red and the C- is blue. Is there a way to do something
> like this within AMRITA?
You can overlay a segmented curve using the commands:
move x,y
draw x,y
line x1,y1,x2,y2
The lines will be drawn using the current colour, which is set
using the commands:
m
rgb
hls
There isn't a command to set the line width directly, but you can change the width by injecting raw PostScript into the plot file. For details, check out the manual page for amrita:gl::ps .
If the built-in functionality is not sufficient, I would suggest you use either Metapost or Asymptote to build an overlay. Both of these packages are free and so are more accessible to people like myself who cannot afford a Matlab licence.
> And we also have a file listing the x-t coordinates of a curve (say,
> the x-t coordinates of a particle path or a C+ characteristic). What
> is the best way to plot the curve on top of the contour plot? This can
> be done by dumping the results extracted by AMRITA simulation into a
> program like MATLAB or Mathematica and having those programs do the
> plotting, but it may be better to do everything on the fly within
> AMRITA
Carlos, building on James' note about re-entrant folds and leveraging
off
other codes/languages, it is possible to both use an external plotting
routine and do it on the fly in AMRITA. Taking gnuplot as an example,
it is possible to write the script which creates the ps figure (which
can
be parameterized e.g. as a Proc.) from data files
generated by AMRITA and run it and display it to screen.
Below are some snippets from an example:
fold::print { gnuplot tracks script
fold> file=$gpfile
set terminal postscript eps enhanced color "Times-
Roman" 26
set output "$psfile"
set size 1,1
set title "$title"
plot [] "$tfile1" u 1:3 w l,"$tfile2" u 1:3 w
l,"$tfile3" u 1:3 w l
q
}
fold::amrita { gnuplot the data
fold::amrita { make Track figures
foreach Q (P,N)
if (!-e "$psfile") then
echo $psfile
execute gnuplot < $gpfile
endif
end foreach
}
fold::amrita { view plots?
if ("$Tracks::plotTracks" eq "Y") then
foreach Q (P,N)
set psfile = \$psfile$n$Q
expand psfile
execute ggv $psfile &
end foreach