Mathias, in reponse to your drawing problem, let me comment.
(I'm the plotutils maintainer, and I wrote all the
libplot/libplotter code.)

You had trouble getting correct output from a PNGPlotter, in
a C++ program.  I've compiled and executed a similar program
without trouble.  Here's my code, based on your code snippet;
it uses a PSPlotter instead of a PNGPlotter, but I hope that
doesn't matter.

#include <plotter.h>

int
main ()
{
  PlotterParams params;

  double _xmin = -10.0;
  double _ymin = -10.0;
  double _xmax = 50.0;
  double _ymax = 50.0;
  double hist_mean = 20.0;
  double hist_sigma = 4.0;

  Plotter::parampl ("BITMAPSIZE", (char*)"1024x768");
  Plotter::parampl ("BG_COLOR", (char*)"white");

  PSPlotter plotter (std::cin, std::cout, std::cerr);

  if (plotter.openpl () < 0)
    {
      std::cerr << "Error: no open ps\n";
      return 1;
    }

  plotter.erase ();
  plotter.fspace (_xmin, _ymin, _xmax, _ymax);

  plotter.flinewidth ( 0.01* (_xmax-_xmin) );

  plotter.pencolorname ("black");

  plotter.fline (0, 0, 0.9*_xmax, 0);
  plotter.fline (0, 0, 0, 0.9*_ymax);

  plotter.endpath ();

  plotter.pencolorname ("red");

  plotter.fmarker (hist_mean - hist_sigma, _ymax/2, 2, 2);
  plotter.fmarker (hist_mean + hist_sigma, _ymax*0.8, 2, 2);

  if (plotter.closepl () < 0)
    {
      std::cerr << "Error when closing plotter\n";
      return 1;
    }

  return 0;
}

The output (which can be piped to ghostview, to be displayed)
consists of two black line segments and two red marker symbols,
which are plus signs.

If you substitute GIFPlotter for PSPlotter, you'll get GIF
output instead of PS output, etc.  The machine I'm on doesn't
have PNG support, so I haven't tried a PNGPlotter yet.

When you compile and run this program, do you get the output
you should?  What if you use a PNGPlotter?

--Rob Maier
P.S.  You should really draw the two line segments by doing

  plotter.fline (0.9*_xmax, 0, 0, 0);
  plotter.fline (0, 0, 0, 0.9*_ymax);

instead.  That way, the line segments will join together.



_______________________________________________
Bug-plotutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-plotutils

Reply via email to