Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Overlaying curves on top of an x-t contour plot
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Carlos  
View profile  
 More options Dec 16 2008, 4:07 pm
From: Carlos <cleun...@uottawa.ca>
Date: Tue, 16 Dec 2008 13:07:20 -0800 (PST)
Local: Tues, Dec 16 2008 4:07 pm
Subject: Overlaying curves on top of an x-t contour plot
How would one go about plotting a curve on top of a contour plot?

Say we have a contour plot on an x-t diagram of say, pressure gradient
generated by a script similar to what is seen in the previous thread:
http://groups.google.com/group/amrita-ebook/browse_thread/thread/77b8...

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?

Thanks,
Carlos


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Carlos  
View profile  
 More options Dec 16 2008, 4:39 pm
From: Carlos <cleun...@uottawa.ca>
Date: Tue, 16 Dec 2008 13:39:03 -0800 (PST)
Local: Tues, Dec 16 2008 4:39 pm
Subject: Re: Overlaying curves on top of an x-t contour plot
Ahh, nevermind about my last question. I can use the rgb<x,y,z> to
colour code lines

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Quirk  
View profile  
 More options Dec 16 2008, 4:39 pm
From: James Quirk <j...@galcit.caltech.edu>
Date: Tue, 16 Dec 2008 13:39:13 -0800 (PST)
Local: Tues, Dec 16 2008 4:39 pm
Subject: Re: Overlaying curves on top of an x-t contour plot
Carlos,

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.

James


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gary Sharpe  
View profile  
 More options Dec 17 2008, 5:31 am
From: Gary Sharpe <men...@leeds.ac.uk>
Date: Wed, 17 Dec 2008 02:31:50 -0800 (PST)
Local: Wed, Dec 17 2008 5:31 am
Subject: Re: Overlaying curves on top of an x-t contour plot

> 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

            endif


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google