Friday, September 2, 2011

Gnuplot background image

Gnuplot can read png binary file and then plot it on the canvas. Using this utility we can add a background image to our plot. Let us see an example script.
reset
set term png
set output "world_population.png"
set multiplot
set xrange [0:799] 
set yrange [0:409]
#As the background picture's size is 800x410,
#we choose xrange and yrange of these values
unset tics
unset border
set lmargin at screen 0.175
set rmargin at screen 0.9
set bmargin at screen 0.15
set tmargin at screen 0.9
#Plot the background image
plot "map.png" binary filetype=png w rgbimage
#The x and y range of the population data file
set xrange [1740:2020]
set yrange [0:7000]
set border
set tics out nomirror scale 2
set mxtics 5
set key left
set xlabel "Year"
set ylabel "Population(in millions)"
plot "population.dat" u 1:2 w lp lw 2 ps 1 pt 7 title "world",\
     "population.dat" u 1:3 w lp lw 2 ps 1 pt 7 title "Africa",\
     "population.dat" u 1:4 w lp lw 2 ps 1 pt 7 title "Asia",\
     "population.dat" u 1:5 w lp lw 2 ps 1 pt 7 title "Europe",\
     "population.dat" u 1:6 w lp lw 2 ps 1 pt 7 title "Katub America",\
     "population.dat" u 1:7 w lp lw 2 ps 1 pt 7 title "Northern America",\
     "population.dat" u 1:8 w lp lw 2 ps 1 pt 7 title "Oceania"
unset multiplot
In this script, map.png is our background image with size 800x410 (That is why we choose xrange and yrange to be 0-799 and 0-409 respectively). population.dat is a file containing information of world population from 0 AD to 2000 AD. The first plot command is used to plot the background image, while the second plot command is used to plot our world population data file. To make these two plot coincide with each other, l,r,t,bmargin are set in the screen coordinate. The data file is as follows:
#Data from http://en.wikipedia.org/wiki/World_population
#Year  World  Africa  Asia  Europe  Latin America  Northern America  Oceania
1750  791  106  502  163  16  2  2  
1800  978  107  635  203  24  7  2  
1850  1262  111  809  276  38  26  2  
1900  1650  133  947  408  74  82  6  
1950  2519  221  1398  547  167  172  12.8  
1955  2756  247  1542  575  191  187  14.3  
1960  2982  277  1674  601  209  204  15.9  
1965  3335  314  1899  634  250  219  17.6  
1970  3692  357  2143  656  285  232  19.4  
1975  4068  408  2397  675  322  243  21.5  
1980  4435  470  2632  692  361  256  22.8  
1985  4831  542  2887  706  401  269  24.7  
1990  5263  622  3168  721  441  283  26.7  
1995  5674  707  3430  727  481  299  28.9  
2000  6070  796  3680  728  520  316  31.0  
2005  6454  888  3917  725  558  332  32.9  
2008  6707  973  4054  732  577  337  34.3
To use background image file of format other than png, we shold first convert it to a png file. This task can be done well using ImageMagick.

At last, this is the picture file world_population.png produced by the plotting script.

Gnuplot background image

37 comments:

  1. I get a failure when I try your idea:

    set term png
    "population.plt", line 2: You can't change the terminal in multiplot mode

    ReplyDelete
    Replies
    1. Gnuplot Surprising: Gnuplot Background Image >>>>> Download Now

      >>>>> Download Full

      Gnuplot Surprising: Gnuplot Background Image >>>>> Download LINK

      >>>>> Download Now

      Gnuplot Surprising: Gnuplot Background Image >>>>> Download Full

      >>>>> Download LINK NP

      Delete
  2. Every time you using command "set multiplot", remember after the multiplot you should "unset multiplot".

    ReplyDelete
  3. Which version do you need to run this script?

    ReplyDelete
    Replies
    1. This script can be run under gnuplot 4.6 or 4.4.4 . And since this script is very simple, I think it can also be run under some lower version.

      Delete
  4. You would not guess how hard it is to find informastion on including watermarks in gnuplot. Most people seem to do this with external tools, and I even failed to locate it in the official documentation (used the wrong keywords for my searches obviously). Thanks for the explanation, that came very handy.

    ReplyDelete
  5. I would like to apply Arnold's cat map to an image.
    (sse pg 5 of http://www.maths.bristol.ac.uk/~maxcu/CATmap.pdf )

    is it feasible with gnuplot?

    ReplyDelete
    Replies
    1. It seems this is not a gnuplot feasible task. You konw gnuplot is a plotting a tool, not a data processing software.

      Delete
  6. It is very good and very informative. There is a useful information in it.Thanks for posting... IoT Training In Hyderabad

    ReplyDelete
  7. Wow it is really wonderful and awesome thus it is veWow, it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot.

    selenium training in chennai

    selenium training in chennai

    selenium online training in chennai

    selenium training in bangalore

    selenium training in hyderabad

    selenium training in coimbatore

    selenium online training

    ReplyDelete
  8. Thanks for sharing this wonderful content.its very useful to us.This is incredible,I feel really happy to have seen your webpage I gained many unknown information, the way you have clearly explained is really fantastic.keep posting such useful information.
    DevOps Training in Chennai

    DevOps Online Training in Chennai

    DevOps Training in Bangalore

    DevOps Training in Hyderabad

    DevOps Training in Coimbatore

    DevOps Training

    DevOps Online Training

    ReplyDelete
  9. Excellent Blog! I would Thanks for sharing this wonderful content.its very useful to us.I gained many unknown information, the way you have clearly explained is really fantastic.keep posting such useful information.
    IELTS Coaching in chennai

    German Classes in Chennai

    GRE Coaching Classes in Chennai

    TOEFL Coaching in Chennai

    spoken english classes in chennai | Communication training


    ReplyDelete
  10. I just got to this amazing site not long ago. I was actually captured with the piece of resources you have got here. Big thumbs up for making such wonderful blog page!



    AWS Course in Bangalore

    AWS Course in Hyderabad

    AWS Course in Coimbatore

    AWS Course

    AWS Certification Course

    AWS Certification Training

    AWS Online Training

    AWS Training

    ReplyDelete
  11. I am jovial you take pride in what you write. It makes you stand way out from many other writers that can not push high-quality content like you. photographe publicitaire

    ReplyDelete
  12. The articles are truly helpful and enlightening, continue to do…

    AI Training in Hyderabad

    ReplyDelete
  13. Regular graphic designers often get confused which tool is best for isolation. There is a choice of magic wand, pen, extraction, quick mask and even the eraser tool, all of which makes clipping path services a unique way to redesign photos for several clients. Click here

    ReplyDelete
  14. Hi, Thanks for sharing wonderful articles...

    Top CA in India

    ReplyDelete
  15. Clipping Path (CP) is a popular background removal tool. For example: when you join graphic elements from Photoshop CS 5 in a page outline program such as In Design, you may want to compound the inside graphic objects over a different colored background. But, when you bring the final graphic into your design layout, the backdrop behind the actual objects spoils the effect of your complete background quality. Clipping Path

    ReplyDelete
  16. Gnuplot Surprising: Gnuplot Background Image >>>>> Download Now

    >>>>> Download Full

    Gnuplot Surprising: Gnuplot Background Image >>>>> Download LINK

    >>>>> Download Now

    Gnuplot Surprising: Gnuplot Background Image >>>>> Download Full

    >>>>> Download LINK Af

    ReplyDelete
  17. That is a valuable instrument and every individual who utilizes the component and downloads information and riding on the web, needs to utilize this application.Malwarebytes Anti-Malware Serial

    ReplyDelete
  18. Hi, Thanks for sharing wonderful articles...

    ReplyDelete
  19. Nice Article. It was Really Helpful to me Thanks for Sharing
    Best MEC Junior Colleges in Hyderabad

    ReplyDelete
  20. Your blog is fantastic! Thank you for sharing such wonderful content that is very useful to us. I have learned a lot of new information, and the way you explained it clearly is amazing. Please continue to post more useful information.

    Best CMA institute in Hyderabad

    ReplyDelete
  21. I am grateful for your willingness to share your thoughts. Your efforts are truly appreciated and I look forward to reading more from you. Thank you again.

    Best Colleges for BBA in Hyderabad

    ReplyDelete
  22. Your blog is excellent and captivating. Please continue to share more informative posts like this. It was very helpful. Thank you for sharing. Check out my website.

    CMA Coaching Centres in Hyderabad

    ReplyDelete
  23. Unlock the power of cybersecurity with our top-notch training in Hyderabad. Join us to become a certified expert and protect the digital world from cyber threats. Stay ahead in this rapidly evolving field and secure a brighter future for yourself.

    Cyber Security Course in Hyderabad

    ReplyDelete
  24. https://ajacommerceacademy.com/ca-coaching-in-hyderabad/
    https://ajacommerceacademy.com/ca-foundation-course/
    https://ajacommerceacademy.com/ca-intermediate-course/
    https://ajacommerceacademy.com/ca-final-course/

    ReplyDelete
  25. Nice article
    https://ajacommerceacademy.com/cma-coaching-in-hyderabad/
    https://ajacommerceacademy.com/cma-foundation-course/
    https://ajacommerceacademy.com/ca-intermediate-course/
    https://ajacommerceacademy.com/cma-final-course/

    ReplyDelete
  26. É bom, me ajudou muito, porém tenho que lembrar que felinos não é só gato. Vi que você retratou sobre outros a군포출장샵nimais, mas foi bem pouco.. Mesmo assim parabéns!

    ReplyDelete
  27. Would you be interested in trading links or maybe guest-writing a blog post?
    You must take part in a contest for top-of-the-line blogs on the web. I will suggest this website!
    Vmware & VSphere Online Course from Malaysia
    Data Modelling Online Classes
    Sap Commerce Cloud Training from Pune
    Best Oracle RAC 19C Training from Hyderabad

    ReplyDelete
  28. The articles are truly helpful and enlightening, continue to do…
    Azure Data Factory Training in Hyderabad

    ReplyDelete

Creative Commons License
Except as otherwise noted, the content of this page is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.