Menu

Multiple X axis

laura
2009-11-18
2012-09-07
  • laura

    laura - 2009-11-18

    I would like to generate a plot with multiple X axis, I mean, I have these
    values

    x1 = 11, y1= 120

    x2 = 15 , y2 = 145

    where x1, y1 is one result, and have to be in one color, and x2, y2 is another
    result with another color. I have 20 different values per each x1, y1, x2, y2

     
  • lbayuk

    lbayuk - 2009-11-26

    I'm not clear on what you are doing. If you want more than 1 X axis, with
    different scales, then no PHPlot cannot do that. But a scatter-point (or
    points plot) can have any number of (x,y) points. For each X, you can have
    multiple Y, with each Y in a different color. By omitting all but one Y for
    each X, I think you can do what you want.

    Here is a script, using the number pairs from your email, just to see if this
    is in any way what you are trying to do.

    <?php

    require_once 'phplot.php';

    $data = array(

    array('', 134, 150, ''),

    array('', 180, 123, ''),

    array('', 200, 190, ''),

    array('', 120, '', 130),

    array('', 190, '', 110),

    array('', 100, '', 210),

    );

    $plot = new PHPlot(800, 600);

    $plot->SetPlotType('points');

    $plot->SetDataType('data-data');

    $plot->SetDataValues($data);

    $plot->SetPlotAreaWorld(0, 0, 250, 250);

    $plot->SetXTickIncrement(20);

    $plot->SetYTickIncrement(20);

    $plot->SetPointSizes(10);

    $plot->DrawGraph();

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.