[LON-CAPA-users] gnuplot and option response

H. K. Ng hkng at fsu.edu
Wed Dec 3 07:16:49 EST 2014


Thanks Stuart for the fix. I wrapped the plot with a table tag but your
solution is much tidier! - hk

On Tue, Dec 2, 2014 at 4:20 PM, Stuart Raeburn <raeburn at msu.edu> wrote:

> Hi Hon-Kie,
>
> > The figures are not in the right place for the option selections.
>
> I expect you have already resolved this.
>
> Anyway, I found that eliminating the 'align="left"' string from the
> contents of the $gnuplot scalar assigned in the script block resulted
> in alignment of a select box to the left of each dynamically generated
> gnuplot image for each foil, with the foils themselves stacked
> vertically.
>
> Stuart Raeburn
> LON-CAPA Academic Consortium
>
> Quoting "H. K. Ng" <hkng at fsu.edu>:
>
> > Hi,
> >
> > It seems that images generated using gnuplot do not line up the same way
> as
> > previously generated images. The images are staggered, not like
> >
> > image - selection
> > image - selection
> >
> > See example below. Anyone knows how to fix this?
> >
> > Thanks,
> > -hk
> >
> > <problem>
> > <script type="loncapa/perl">
> > $gnuplot = &plotThis();
> >
> > sub plotThis {
> >
> > $gnuplot=<<GNUPLOT;
> > <gnuplot width="200" transparent="off" samples="100" grid="on" font="10"
> > bgcolor="xffffff" height="200" align="left" fgcolor="x000000" border="on"
> > plottype="Cartesian" texwidth="70" fontface="sans-serif" bmargin="4"
> > rmargin="1" tmargin="2" lmargin="6" texfont="12">
> >     <axis xmin="-5" ymin="-4" xmax="5" ymax="4" color="x000000"
> > yzero="thick-line" xzero="line" />
> >     <ytics minorfreq="2" location="border" mirror="off" increment="2"
> > start="-4" />
> >     <xlabel>Label X</xlabel>
> >     <ylabel>Label Y</ylabel>
> >     <curve linestyle="lines" color="x000000" pointtype="2"
> > linetype="dashed" linewidth="1" limit="closed" pointsize="1">
> >         <function>sin(x)</function>
> >     </curve>
> > </gnuplot>
> > GNUPLOT
> > return $gnuplot;
> > }
> > </script>
> > <startouttext />
> > The figures are not in the right place for the option selections.
> > <endouttext />
> >
> > <optionresponse max="600" randomize="no" id="13">
> >    <foilgroup options="('Select 1','Select 2','Select 3')">
> >       <foil value="Select 1" name="s1">
> >          <startouttext /><parse>$gnuplot</parse><endouttext />
> >       </foil>
> >       <foil value="Select 2" name="s2">
> >          <startouttext /><parse>$gnuplot</parse><endouttext />
> >       </foil>
> >       <foil value="Select 3" name="s3">
> >         <startouttext /><parse>$gnuplot</parse><endouttext />
> >       </foil>
> >       </foilgroup>
> > </optionresponse>
> >
> > </problem>
>
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users at mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.lon-capa.org/pipermail/lon-capa-users/attachments/20141203/2f8f877a/attachment-0001.html>


More information about the LON-CAPA-users mailing list