Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Thanks! Awesome group. I put out a simple question in the access/vba forum that I couldn't find answered on technet or anywhere else on the web and it was answered the same day!!..."

Geography

Where in the world do Tek-Tips members come from?

Looking for a x-window fortran graphic-lib

rambazamba (TechnicalUser)
22 May 12 7:53
Hi!

For my study project in computational physics i need to program some cellular automata. Unfortunatly i have to do it in Fortran, in which i don't have any experience.
Anyway the code is not very difficult so i managed to program some automata with two different rules :) So far so good, but i really need to find a way how i can display the result in an quick and easy way. I'm working both on a Linux and a MacOSX Machine, so the best way is to find a easy x-Window Graphic lib. I'm using gfortran compiler if this is important?

Maybe someone can recommend one?

thousand thanks in advance!

rambazamba
gummibaer (Programmer)
22 May 12 8:52
This link

http://fortranwiki.org/fortran/show/Libraries

gives a list of libraries amongst which are graphic libraries.

Norbert

The optimist believes we live in the best of all possible worlds - the pessimist fears this might be true.

rambazamba (TechnicalUser)
22 May 12 13:40
Hey Norbert!

Thank you for the Link! Gnufor2 lookes like a very easy way to do exactly what i want to. But until know i spent a couple of hours solving problems to get the testfile to run.

Now everything seems to work with the test.f90 - but not with my own source code.

I don't get the problem, i'm doing it exactly as in the testfile. Unfortunatly there is no further documentation to this library or any similar gnuplot interface libs i found on the internet.

My Problem is:
After the calculation is done, i have a NxN matrix with ones and zeros and i want them to be visualised as "1 = pixel is black" or "zero = pixel is white".
Is there any other easy way to get this result?

Thanks again

Greetings

rambazamba
melmacianalf (TechnicalUser)
22 May 12 14:27
I do it using gnuplot.

Store only the ones like this in plot.dat

1 1 1.00000000000000
1 2 1.00000000000000
1 5 1.00000000000000
1 6 1.00000000000000
1 10 1.00000000000000
...

Use the gnuplot script

CODE --> gnuplot

set term gif set output "plot.eps" set size square unset xlabel unset ylabel unset xtic unset ytic unset border set pointsize 1 plot 'plot.dat' u 1:2 notitle w p pt 5 lc rgb "black"
melmacianalf (TechnicalUser)
22 May 12 15:12
My bad..

Just keep the row and column indices in 'plot.dat', no need to store 1.00000

make the first two lines on the script consistent

set term gif
set output "plot.gif"

OR

set term eps
set output "plot.eps"
gummibaer (Programmer)
22 May 12 15:51
What size is your matrix, that is how big is your n ? You could just define a printout matrix that shows blanks for every 0 and X for every 1 and write it to your screen. If N is not more than your textural screen resolution (150 by 150 or so) you may get a good impression of your results.

If your matrix is bigger you could create and fill a bitmap with your results. But I am not familiar with neither Linux nor MAC on how such an image could be displayed.

Norbert

The optimist believes we live in the best of all possible worlds - the pessimist fears this might be true.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close