Loading ...
Sorry, an error occurred while loading the content.
 

prefab use in script

Expand Messages
  • peteanom k
    Hello, for a project of mine i need to generate a lot of graphs. For this i like to use ploticus. I only would like to limit my self in generating one file per
    Message 1 of 5 , May 25, 2006
      Hello,

      for a project of mine i need to generate a lot of graphs. For this i like to use ploticus. I only would like to limit my self in generating one file per result set, a script file including the data, but preferable without much effort. Prefabs are nice, but require the generate one data file and a file (a shell script) specifying how to use the data and how to plot it). Or i could use inline data but that is limited to 255 chars.

      I would like to generate somehting like groupbarplot.pl:

      > include $vbars.pl
      >
      > #proc getdata:
      >   data: Group1,10
      >           Group2,23
      >           Group3,23
      >           <moredata>
      >
      > //// prefab settings:
      > title="barplot from groups 1-10"
      > x=1
      > y=2
      > vals=yes
      > <other prefab settings>

      then rendering a plot would only be: pl -png -f groupbarplot.pl

      hope anyone can help me out!

      Cheers, Pete
    • Stephen C. Grubb
      Pete, are shell scripts an option? You could do something like this: #!/bin/sh echo #set title = barplot from groups 1-10 #set x = 1 #set y = 2 #set vals =
      Message 2 of 5 , May 25, 2006
        Pete, are shell scripts an option? You could do something like this:

        #!/bin/sh

        echo "
        #set title = barplot from groups 1-10
        #set x = 1
        #set y = 2
        #set vals = yes
        Group1,10
        Group2,23
        Group3,23
        ....
        " > /tmp/mydat

        pl -prefab vbars data=/tmp/mydat delim=comma

        ------------------

        I haven't tried this, but it seems like it should work.

        Steve



        On Thu, 25 May 2006, peteanom k wrote:

        > Hello,
        >
        > for a project of mine i need to generate a lot of graphs. For this i like to
        > use ploticus. I only would like to limit my self in generating one file per
        > result set, a script file including the data, but preferable without much
        > effort. Prefabs are nice, but require the generate one data file and a file
        > (a shell script) specifying how to use the data and how to plot it). Or i
        > could use inline data but that is limited to 255 chars.
        >
        > I would like to generate somehting like groupbarplot.pl:
        >
        > > include $vbars.pl
        > >
        > > #proc getdata:
        > > data: Group1,10
        > > Group2,23
        > > Group3,23
        > > <moredata>
        > >
        > > //// prefab settings:
        > > title="barplot from groups 1-10"
        > > x=1
        > > y=2
        > > vals=yes
        > > <other prefab settings>
        >
        > then rendering a plot would only be: pl -png -f groupbarplot.pl
        >
        > hope anyone can help me out!
        >
        > Cheers, Pete
        >


        Stephen C. Grubb scg@... x-6633
        Scientific Software Engineer, The Jackson Laboratory
        600 Main Street Bar Harbor, Maine 04609 USA
      • peteanom k
        it will probably work, but it now creates a temporary file, smth that i rather would like to avoid, but ok, using data=- and piping the actual data can avoid
        Message 3 of 5 , May 25, 2006
          it will probably work, but it now creates a temporary file, smth that i rather would like to avoid, but ok, using data=- and piping the actual data can avoid this. but i do lose platform independance with it.

          the issue is more that calling pl is now not really transparent, it differs for prefab and scripts. if it would be somehow similar, it would be nicer to implement in my tool. A proc for setting prefabs in a script would be a nice solution.

          Thanks for the help,
          Peter

          On 5/25/06, Stephen C. Grubb <scg@...> wrote:

          Pete, are shell scripts an option?  You could do something like this:

          #!/bin/sh

          echo "
          #set title = barplot from groups 1-10
          #set x = 1
          #set y = 2
          #set vals = yes
          Group1,10
          Group2,23
          Group3,23
          ....
          " > /tmp/mydat

          pl -prefab vbars data=/tmp/mydat delim=comma

          ------------------

          I haven't tried this, but it seems like it should work.

          Steve



          On Thu, 25 May 2006, peteanom k wrote:

          > Hello,
          >
          > for a project of mine i need to generate a lot of graphs. For this i like to
          > use ploticus. I only would like to limit my self in generating one file per
          > result set, a script file including the data, but preferable without much
          > effort. Prefabs are nice, but require the generate one data file and a file
          > (a shell script) specifying how to use the data and how to plot it). Or i
          > could use inline data but that is limited to 255 chars.
          >
          > I would like to generate somehting like groupbarplot.pl:
          >
          > > include $vbars.pl
          > >
          > > #proc getdata:
          > >   data: Group1,10
          > >           Group2,23
          > >           Group3,23
          > >           <moredata>
          > >
          > > //// prefab settings:
          > > title="barplot from groups 1-10"
          > > x=1
          > > y=2
          > > vals=yes
          > > <other prefab settings>
          >
          > then rendering a plot would only be: pl -png -f groupbarplot.pl
          >
          > hope anyone can help me out!
          >
          > Cheers, Pete
          >


            Stephen C. Grubb     scg@...                x-6633
            Scientific Software Engineer, The Jackson Laboratory
            600 Main Street  Bar Harbor, Maine 04609 USA





          ------------------------ Yahoo! Groups Sponsor --------------------~-->
          Get to your groups with one click. Know instantly when new email arrives
          http://us.click.yahoo.com/.7bhrC/MGxNAA/yQLSAA/_iFolB/TM
          --------------------------------------------------------------------~->


          Yahoo! Groups Links

          <*> To visit your group on the web, go to:
              http://groups.yahoo.com/group/ploticus/

          <*> To unsubscribe from this group, send an email to:
              ploticus-unsubscribe@yahoogroups.com

          <*> Your use of Yahoo! Groups is subject to:
              http://docs.yahoo.com/info/terms/





        • Stephen C. Grubb
          Peter, another thought..... prefabs are implemented as scripts in your ./prefabs directory.. and I assume could be #included like any other script code. you
          Message 4 of 5 , May 26, 2006
            Peter, another thought.....

            prefabs are implemented as scripts in your ./prefabs directory.. and I
            assume could be #included like any other script code.


            you could try writing a script like this:


            #proc getdata
            data: 2 3 4
            4 5 6
            ...

            #set x = 1
            #set y = 2
            <set other prefab parameters>

            #include $vbars.pl

            ....... the dollar sign tells it to look in the prefabs directory

            ....... you'd also have to edit ./prefabs/chunk_read and comment out the
            code in there that has to do with reading in data, since you'll have
            already done this.

            If this turns out to be a useful approach let me know and I can make some
            changes to make this more convenient, and mention it in the docs.


            Steve




            On Fri, 26 May 2006, peteanom k wrote:

            > it will probably work, but it now creates a temporary file, smth that i
            > rather would like to avoid, but ok, using data=- and piping the actual data
            > can avoid this. but i do lose platform independance with it.
            >
            > the issue is more that calling pl is now not really transparent, it differs
            > for prefab and scripts. if it would be somehow similar, it would be nicer to
            > implement in my tool. A proc for setting prefabs in a script would be a nice
            > solution.
            >
            > Thanks for the help,
            > Peter
            >
            > On 5/25/06, Stephen C. Grubb <scg@...> wrote:
            > >
            > >
            > > Pete, are shell scripts an option? You could do something like this:
            > >
            > > #!/bin/sh
            > >
            > > echo "
            > > #set title = barplot from groups 1-10
            > > #set x = 1
            > > #set y = 2
            > > #set vals = yes
            > > Group1,10
            > > Group2,23
            > > Group3,23
            > > ....
            > > " > /tmp/mydat
            > >
            > > pl -prefab vbars data=/tmp/mydat delim=comma
            > >
            > > ------------------
            > >
            > > I haven't tried this, but it seems like it should work.
            > >
            > > Steve
            > >
            > >
            > >
            > > On Thu, 25 May 2006, peteanom k wrote:
            > >
            > > > Hello,
            > > >
            > > > for a project of mine i need to generate a lot of graphs. For this i
            > > like to
            > > > use ploticus. I only would like to limit my self in generating one file
            > > per
            > > > result set, a script file including the data, but preferable without
            > > much
            > > > effort. Prefabs are nice, but require the generate one data file and a
            > > file
            > > > (a shell script) specifying how to use the data and how to plot it). Or
            > > i
            > > > could use inline data but that is limited to 255 chars.
            > > >
            > > > I would like to generate somehting like groupbarplot.pl:
            > > >
            > > > > include $vbars.pl
            > > > >
            > > > > #proc getdata:
            > > > > data: Group1,10
            > > > > Group2,23
            > > > > Group3,23
            > > > > <moredata>
            > > > >
            > > > > //// prefab settings:
            > > > > title="barplot from groups 1-10"
            > > > > x=1
            > > > > y=2
            > > > > vals=yes
            > > > > <other prefab settings>
            > > >
            > > > then rendering a plot would only be: pl -png -f groupbarplot.pl
            > > >
            > > > hope anyone can help me out!
            > > >
            > > > Cheers, Pete
            > > >
            > >
            > >
            > > Stephen C. Grubb scg@... x-6633
            > > Scientific Software Engineer, The Jackson Laboratory
            > > 600 Main Street Bar Harbor, Maine 04609 USA
            > >
            > >
            > >
            > >
            > >
            > >
            > >
            > > Yahoo! Groups Links
            > >
            > >
            > >
            > >
            > >
            > >
            > >
            > >
            >


            Stephen C. Grubb scg@... x-6633
            Scientific Software Engineer, The Jackson Laboratory
            600 Main Street Bar Harbor, Maine 04609 USA
          • peteanom k
            yes i also figured this out. think that also an overall include could be usefull which includes every prefab, than a switch could be used to set the prefab for
            Message 5 of 5 , May 29, 2006
              yes i also figured this out. think that also an overall include could be usefull which includes every prefab, than a switch could be used to set the prefab for rendering the plot. didnt tried that one yet. i'll try to let you know what fits my needs best.

              thanks for the advice, keep me posted on any new ideas!
              Peter

              On 5/26/06, Stephen C. Grubb <scg@...> wrote:

              Peter, another thought.....

              prefabs are implemented as scripts in your ./prefabs directory.. and I
              assume could be #included like any other script code.


              you could try writing a script like this:


              #proc getdata
                data:   2 3 4
                        4 5 6
                        ...

              #set x = 1
              #set y = 2
              <set other prefab parameters>

              #include $vbars.pl

              ....... the dollar sign tells it to look in the prefabs directory

              ....... you'd also have to edit ./prefabs/chunk_read and comment out the
              code in there that has to do with reading in data, since you'll have
              already done this.

              If this turns out to be a useful approach let me know and I can make some
              changes to make this more convenient, and mention it in the docs.


              Steve




              On Fri, 26 May 2006, peteanom k wrote:

              > it will probably work, but it now creates a temporary file, smth that i
              > rather would like to avoid, but ok, using data=- and piping the actual data
              > can avoid this. but i do lose platform independance with it.
              >
              > the issue is more that calling pl is now not really transparent, it differs
              > for prefab and scripts. if it would be somehow similar, it would be nicer to
              > implement in my tool. A proc for setting prefabs in a script would be a nice
              > solution.
              >
              > Thanks for the help,
              > Peter
              >
              > On 5/25/06, Stephen C. Grubb <scg@...> wrote:
              > >
              > >
              > > Pete, are shell scripts an option?  You could do something like this:
              > >
              > > #!/bin/sh
              > >
              > > echo "
              > > #set title = barplot from groups 1-10
              > > #set x = 1
              > > #set y = 2
              > > #set vals = yes
              > > Group1,10
              > > Group2,23
              > > Group3,23
              > > ....
              > > " > /tmp/mydat
              > >
              > > pl -prefab vbars data=/tmp/mydat delim=comma
              > >
              > > ------------------
              > >
              > > I haven't tried this, but it seems like it should work.
              > >
              > > Steve
              > >
              > >
              > >
              > > On Thu, 25 May 2006, peteanom k wrote:
              > >
              > > > Hello,
              > > >
              > > > for a project of mine i need to generate a lot of graphs. For this i
              > > like to
              > > > use ploticus. I only would like to limit my self in generating one file
              > > per
              > > > result set, a script file including the data, but preferable without
              > > much
              > > > effort. Prefabs are nice, but require the generate one data file and a
              > > file
              > > > (a shell script) specifying how to use the data and how to plot it). Or
              > > i
              > > > could use inline data but that is limited to 255 chars.
              > > >
              > > > I would like to generate somehting like groupbarplot.pl:
              > > >
              > > > > include $vbars.pl
              > > > >
              > > > > #proc getdata:
              > > > >   data: Group1,10
              > > > >           Group2,23
              > > > >           Group3,23
              > > > >           <moredata>
              > > > >
              > > > > //// prefab settings:
              > > > > title="barplot from groups 1-10"
              > > > > x=1
              > > > > y=2
              > > > > vals=yes
              > > > > <other prefab settings>
              > > >
              > > > then rendering a plot would only be: pl -png -f groupbarplot.pl
              > > >
              > > > hope anyone can help me out!
              > > >
              > > > Cheers, Pete
              > > >
              > >
              > >
              > >   Stephen C. Grubb     scg@...                x-6633
              > >   Scientific Software Engineer, The Jackson Laboratory
              > >   600 Main Street  Bar Harbor, Maine 04609 USA
              > >
              > >
              > >
              > >
              > >
              > >
              > >
              > > Yahoo! Groups Links
              > >
              > >
              > >
              > >
              > >
              > >
              > >
              > >
              >


                Stephen C. Grubb     scg@...                x-6633
                Scientific Software Engineer, The Jackson Laboratory
                600 Main Street  Bar Harbor, Maine 04609 USA





              ------------------------ Yahoo! Groups Sponsor --------------------~-->
              Home is just a click away. Make Yahoo! your home page now.
              http://us.click.yahoo.com/DHchtC/3FxNAA/yQLSAA/_iFolB/TM
              --------------------------------------------------------------------~->


              Yahoo! Groups Links

              <*> To visit your group on the web, go to:
                  http://groups.yahoo.com/group/ploticus/

              <*> To unsubscribe from this group, send an email to:
                  ploticus-unsubscribe@yahoogroups.com

              <*> Your use of Yahoo! Groups is subject to:
                  http://docs.yahoo.com/info/terms/





            Your message has been successfully submitted and would be delivered to recipients shortly.