Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello, is there an application that can read a file with x-y values and then create a graphic as a jpg 2d image (or other image format) as output?
The file would be like this:
I think you need to define your desired output a bit more clearly. I really don't understand what you want at this point. By "graphic" do you mean a graph? What kind of graph? How should the data be displayed?
I think you need to define your desired output a bit more clearly. I really don't understand what you want at this point. By "graphic" do you mean a graph? What kind of graph? How should the data be displayed?
The output I want is a bar chart jpg image. I am looking for a console application so I can create the bar charts using a bash script. The data should be displayed, in the x axis, the names of the persons and in the y axis, the number of posts they have made. This is only an example, the real files have much more data and it will be a really tedious thing to do it manually using open office. I want to make bar charts similar to those you would get by creating the bar charts in open office´s calc, then taking a screen shoots from them and saving them with jpg format. The thing is that I don't want to do this process manually, but automatically using a bash script.
A spreadsheet program typically has plotting capabilities----something like OpenOffice calc will open most ordered files.
I know, but is there any way I can use OpenOffice calc or any other program in a bash script to create several bar charts automatically by giving them the files with the information required?
You can use gnuplot to produce a bar graph & use the jpeg output driver. You may want to produce a file containing the data in a form gnu plot expects, write a gnuplot script that will use this datafile and create the jpeg graph, and then call: gnuplot <your_gnu_plot_script>.
From the info file:
Code:
Examples:
To plot a data file with solid filled boxes with a small vertical
space separating them (bargraph):
set boxwidth 0.9 relative
set style fill solid 1.0
plot 'file.dat' with boxes
Also use locate to locate the html and/or pdf documentation for gnuplot.
Other options could be using postscript or latex graphic commands. There is a gnuplottex version of latex, but I don't know if you can produce jpeg files from the results.
There is also the plotutils package including the plot command. They can produce ps, png or psuedo-gif files as output which you could convert easily to jpeg.
From the plot info manual:
Code:
To produce a PNG file, you would do
plot -T png < test.meta > test.png
If you will be using these plots for a college paper, you may want to use an eps output filter instead of png. LaTeX works better importing eps graphics. ( pdftex may be different )
Hello, thanks for the tip. I have searched gnuplot in google and it seems it could be just what I need, but the example source codes (http://gnuplot.sourceforge.net/demo/histograms.html) only make reference to an inmigration.dat file in which the data is stored. Do you know what is the format required to input this data? Thanks
You can use gnuplot to produce a bar graph & use the jpeg output driver. You may want to produce a file containing the data in a form gnu plot expects, write a gnuplot script that will use this datafile and create the jpeg graph, and then call: gnuplot <your_gnu_plot_script>.
From the info file:
Code:
Examples:
To plot a data file with solid filled boxes with a small vertical
space separating them (bargraph):
set boxwidth 0.9 relative
set style fill solid 1.0
plot 'file.dat' with boxes
Also use locate to locate the html and/or pdf documentation for gnuplot.
Other options could be using postscript or latex graphic commands. There is a gnuplottex version of latex, but I don't know if you can produce jpeg files from the results.
There is also the plotutils package including the plot command. They can produce ps, png or psuedo-gif files as output which you could convert easily to jpeg.
From the plot info manual:
Code:
To produce a PNG file, you would do
plot -T png < test.meta > test.png
If you will be using these plots for a college paper, you may want to use an eps output filter instead of png. LaTeX works better importing eps graphics. ( pdftex may be different )
Thanks a lot for the help , it seems that gnuplot is the right program for what I need. I have to install a separate jpeg output driver or is it integrated with gnuplot? I will start to read gnuplot docs and I will come back to post if I have any more doubts.
NAME
convert - convert between image formats as well as resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more.
SYNOPSIS
convert input-file [options] output-file
OVERVIEW
The convert program is a member of the ImageMagick(1) suite of tools. Use it to convert between image formats as well as resize an image, blur, crop, despeckle, dither, draw on, flip,
join, re-sample, and much more.
For more information about the convert command, point your browser to file:///usr/share/doc/ImageMagick-6.4.3/www/convert.html or http://www.imagemagick.org/script/convert.php.
to convert a file from png to jpg, simply use
convert <pngfilename> <jpegfilename>
or
more generally:
convert $pngfile ${pngfile%.png}.jpg
the plot and gnuplot programs may have documentation in your /usr/share/doc/ directory. I have html & pdf documentation. The pdf file is about 200 pages long.
NAME
convert - convert between image formats as well as resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more.
SYNOPSIS
convert input-file [options] output-file
OVERVIEW
The convert program is a member of the ImageMagick(1) suite of tools. Use it to convert between image formats as well as resize an image, blur, crop, despeckle, dither, draw on, flip,
join, re-sample, and much more.
For more information about the convert command, point your browser to file:///usr/share/doc/ImageMagick-6.4.3/www/convert.html or http://www.imagemagick.org/script/convert.php.
to convert a file from png to jpg, simply use
convert <pngfilename> <jpegfilename>
or
more generally:
convert $pngfile ${pngfile%.png}.jpg
the plot and gnuplot programs may have documentation in your /usr/share/doc/ directory. I have html & pdf documentation. The pdf file is about 200 pages long.
Thanks I already installed gnuplot and made my first graphs using a IBM Tutorial ( http://www.ibm.com/developerworks/li...r-wikiaGnuplot ), it seems really nice. I am currently compiling imagemagick and I think it is going to be very useful to me also. Thanks for being generous with your knowledge.
Last edited by DeepSeaNautilus; 06-17-2010 at 10:30 PM.
Use your package manager to install ImageMagick. Only extremely small pendrive based distro's won't have it. The package will also install the documentation. The manpages for each ImageMagick program contain a link to documentation on their site:
file:///usr/share/doc/ImageMagick-6.4.3/www/convert.html or http://www.imagemagick.org/script/convert.php.
Your documentation may be in /usr/share/doc/packages/ImageMagick/ if you have SuSE Linux.
Use your package manager to install ImageMagick. Only extremely small pendrive based distro's won't have it. The package will also install the documentation. The manpages for each ImageMagick program contain a link to documentation on their site:
file:///usr/share/doc/ImageMagick-6.4.3/www/convert.html or http://www.imagemagick.org/script/convert.php.
Your documentation may be in /usr/share/doc/packages/ImageMagick/ if you have SuSE Linux.
I got an error when I tried to install it by compiling it, so I installed it using my packet manager as you say and it works pretty well, thanks. I have seen a couple of examples of how to do bar charts in gnuplot, but I have not find the format required for the data.dat file than is referenced in the gnuplot file. Could you help me with this?
Hello, I make this script for creating a bar chart:
set encoding iso_8859_1
Code:
set terminal postscript color
set output "example2.eps"
set xrange [0:30]
set yrange [0:5]
set xtics ("uno" 1, "dos" 2, "tres" 3, "cuatro" 4)
set data style boxes
set boxwidth 0.2
#comentario
plot "example.dat" using 1:2 title "first record"
The problem is that when I have a lot of data, the labels of the x axis overlap, is there any way I can rotate the tags 90 degrees?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.