Menu

Plot points stored in three arrays (X, Y, Z coordinates)

General
av69
2014-07-29
2014-09-29
  • av69

    av69 - 2014-07-29

    Hi,

    I want to plot points defined as (x, y, z) coordinates. I only found the way to plot using surfaces functions, but not raw data. I saw people asking this question before but they didn't have any answer.

    Thanks!

     
  • Sintegrial Technologies

    Hi,

    it is possible with the VolumePlot which is available since version 0.3.1. The latest update you can get here: http://sintegrial.com/qwtplot/pages/en/index.php

     
  • av69

    av69 - 2014-08-01

    Thanks!

    Is there any example or which function should i use to plot samples??

     
  • Sintegrial Technologies

    Sure, there is VolumePlot example shipped with the distribution. Its usage is quite easy, you just need to pass the 3-coordinates array to the volume plotter class.

     
  • Nuno Pedrosa

    Nuno Pedrosa - 2014-08-31

    Hi I have been trying to use this feature but I hit a library bug.
    when one of the axis has a high range say 0:1E7 and other have lower ranges say 0:20, 0:700 I get squished plot.

    you can try this with the simpleplot example, replace the setDomain call there with:
    rosenbrock.setDomain(-1.73,1.5e6,-1.5,1.5);

    then you get the attached screenshot.

    Maybe some normalizing has to be done to the data before displaying it.

    Apart from this nag it seems to be a great library to work with.
    Thanks

     
  • av69

    av69 - 2014-09-29

    Hi again,

    Finally i solved using volumeplot as Sintegrial Technologies mentioned above, here i attach an example of the process i did:

    //Creating a widget and adding a VolumePlot inside:
    QWidget *wm3D = new QWidget(this);
    m3Dplot = new VolumePlot(wm3D);

    //Function example of how to add data:
    void form::add_m3Ddata_point(double x, double y, double z){
    m3Ddata.push_back(Voxel(x,y,z,0,0,255,255)); // The last 4 numbers are for select the color in rgba format
    }

    //Adding the data to the VolumePlot:
    m3Dplot->createDataset(m3Ddata,true);
    m3Dplot->updateData();
    m3Dplot->updateGL();

    Thanks!

     

Log in to post a comment.