Menu

Insert an JPG with PHPlot

Anonymous
2012-01-31
2012-09-07
  • Anonymous

    Anonymous - 2012-01-31

    Hello!

    Is it possible that i can select an picture (.jpg) from the server and include
    it into my graph?

    if yes, how can i made this?

    Thanks for Answers.

     
  • lbayuk

    lbayuk - 2012-01-31

    That's right, if you want to use a JPEG image as your background, you can
    supply the file pathname in the PHPlot constructor (4th argument,
    $input_file), or you can apply it with SetBgImage() to be behind the entire
    image, or with SetPlotAreaBgImage() if you want it to be behind the plot area
    only (not the outside area with titles and labels).

    Please note, if you use SetPlotAreaBgImage or SetBgImage with a JPEG file, you
    should be using the PHPlot_truecolor constructor instead of the PHPlot
    constructor, to avoid overflowing the color map. This is not an issue if you
    supply the background in the constructor itself: $plot = new
    PHPlot(0,0,NULL,'myfile.jpg') will create a truecolor image from myfile.jpg -
    both constructors work the same here.

    If you are trying to do something different, like overlay a JPEG image onto
    part of the plot after drawing it, then no, PHPlot can't do that directly, but
    you can implement that with a drawing callback (see "Using callbacks to
    annotate plots" in the Callbacks section of the reference manual).

     

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.