On 02/25/2017 05:54 AM, Loylick wrote:

I was looking through the documentation but I could not figure out how to make
graphic output of a simiple 1D plot like one I attached to this post.
I had to output my data to a file and draw the graph by hand to show it to
you. My data are just two columns: X, Y. When I look at gnuplot file generated 
by
Dealii I see that it tries to draw my data as 2D plot.
Regards, Alex

|
    MatrixOutmatrix_out;
    FullMatrix<double>DBvsF;
    DBvsF.reinit(2,1000);
    std::vector<double>  frequency;


    doublew;
    doublee =parameters.get_double("dissip");
    unsignedintl;
    unsignedintsz =frequency.size()-1;

    for(l=0;l<1000; l++){
        step =sqrt(w);
        w+=step;
        doubleval =log(DbAtFreq(w,&frequency,e));
        DBvsF(0,l)=w;
        DBvsF(1,l)=val;
    }


   std::ofstream out("DBvsFrequency.plt");
   matrix_out.build_patches(DBvsF,"M");
   matrix_out.write_gnuplot(out);
|

That's too complicated. MatrixOut is intended to visualize the elements of a matrix, but you really just want to visualize pairs (x_i,y_i). Just output these one by one to a file:

  ofstream output("M");
  for (l=0...) {
    ...
    output << w << ' ' << val << std::endl;
  }

and then visualize the resulting data using gnuplot's "plot" command.

Best
 W.



--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 bange...@colostate.edu
                           www: http://www.math.colostate.edu/~bangerth/

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to