Gnuplot image on axis

I'm trying to simulate some progress through some medium. X-axis will represent a location (based on the coordinate x) in the medium.

To make this clear, I would like to surround the image (based on the .png) on ​​the axis x (Wednesday rather broad and not so high to make it look good) my story, mainly as a shortcut xtics / x.

Do you have any suggestions on how to approach this?

Thanks in advance!

+3
source share
1 answer

You can display both images and data on the same team plot or using multiplot . The first option is easier, but the image is inside a graphic, another a little more complicated, but allows arbitrary position "axis image".

Dummy image "gradient.png" axis

enter image description here

Team one chart:

 set yrange[0:1] set xrange[0:1] plot 'gradient.png' binary filetype=png dx=0.0015 dy=0.002 with rgbimage t '',\ x**2 dx = 0.0015 dy = 0.002 with rgbimage t '', \ set yrange[0:1] set xrange[0:1] plot 'gradient.png' binary filetype=png dx=0.0015 dy=0.002 with rgbimage t '',\ x**2 

Result:

enter image description here

Use of multiplier

 set yrange[0:1] set xrange[0:1] set lmargin at screen 0.1 set rmargin at screen 0.98 set tmargin at screen 0.98 set bmargin at screen 0.2 set xtics offset 0,-1.5 set xlabel 'xlabel' offset 0,-1.5 set ylabel 'ylabel' set multiplot plot x**2 set tmargin at screen 0.2 set bmargin at screen 0.15 unset border unset tics unset xlabel unset ylabel unset key set autoscale xy plot 'gradient.png' binary filetype=png with rgbimage unset multiplot 

As you can see, it takes a little more effort. Explain the details:

  • You must set explicit margins so that the axis image can be placed exactly below the main graph.

  • Before the axis of imaging you must remove ranges tics , labels , the reset to autoscale , etc. (so you should also install fixed lmargin and rmargin ).

  • For the construction of the image, use the style of building with rgbimage .

  • You have to fine-tune the offset xtics and xlabel , and mana.

Resulting Image:

enter image description here

+3
source

All Articles