Author Topic: Scientific graphics: 2D plots & 3D surface & contour plots  (Read 12425 times)

Offline _neil_

  • Single posting newcomer
  • *
  • Posts: 3
I'd like to use Code:Blocks to run scientific programs in C and Fortran (simulations and processing experimental data) then plot the results in a variety of forms for analysis. In the source code i'd like to be able to call simple functions eg plot(x,y) for a 2D plot or plot3d(x,y,z) to get a surface or contour plot, without baggage (eg. a whole series of commands defining axes, borders etc). This convenience is how things work in languages of Matlab and IDL, but i'm looking to replace these with opensource equivalents. Might there be a convenient graphics package (either part of Code:Blocks or third party software) i can use with Code:Blocks to do this easily?

many thanks for any help,
Neil

stefanos_

  • Guest
Re: Scientific graphics: 2D plots & 3D surface & contour plots
« Reply #1 on: May 30, 2012, 07:41:42 am »
Greetings Neil.

I have seen a Code::Blocks version for Fortan, and perhaps is what you are looking for.

This is the link http://darmar.vgtu.lt/ ; I have found it with Google's help.

I am pretty sure that the project's maintainer will gladly going to help you or even ask for your participation to his project since you are sharing a more-or-less common goal.

I know nothing about Fortran, therefore I cannot help you with your requests.

Offline xunxun

  • Almost regular
  • **
  • Posts: 187
Re: Scientific graphics: 2D plots & 3D surface & contour plots
« Reply #2 on: May 30, 2012, 08:29:17 am »
You can use mathgl.
It has C and Fortran Interface.
Regards,
xunxun

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Scientific graphics: 2D plots & 3D surface & contour plots
« Reply #3 on: May 30, 2012, 10:45:27 am »
I have seen a Code::Blocks version for Fortan, and perhaps is what you are looking for.
Notice its a Fortran plugin for Code::Blocks (actually these are two: The Fortran project and formatter plugin). You could use these in "standard" C::B, too. They are pretty good work! I am using them myself when I have to develop in Fortran from time to time.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline xunxun

  • Almost regular
  • **
  • Posts: 187
Re: Scientific graphics: 2D plots & 3D surface & contour plots
« Reply #4 on: May 30, 2012, 01:22:18 pm »
I have seen a Code::Blocks version for Fortan, and perhaps is what you are looking for.
Notice its a Fortran plugin for Code::Blocks (actually these are two: The Fortran project and formatter plugin). You could use these in "standard" C::B, too. They are pretty good work! I am using them myself when I have to develop in Fortran from time to time.

I think we can integrate the plugin to C::B trunk plugin?
Regards,
xunxun

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Scientific graphics: 2D plots & 3D surface & contour plots
« Reply #5 on: May 30, 2012, 01:56:47 pm »
I think we can integrate the plugin to C::B trunk plugin?
Maybe, some day. For now, they have their own repositories and work fully independent. We just share incompatibilities to avoid ugly work-arounds and allow seamless integration. There is even an own homepage, support forum and so on. Its not too bad, because Fortran people are not C/C++ people, so de-coupling both project in that way clearly has advantages.

Therefore, until now there was no such request from the developers of these plugins and I can understand if they want to remain independent. What I could think of is that we link the Fortran project plugin as a remote SVN sub-tree in our SVN and integrate it in our build system, so it ships with regular nightlies, too. But this also has dis-advantages like sync'ing releases.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline _neil_

  • Single posting newcomer
  • *
  • Posts: 3
Re: Scientific graphics: 2D plots & 3D surface & contour plots
« Reply #6 on: May 30, 2012, 03:49:00 pm »
All,

thanks for the good suggestions. I'm now thinking it might be easier if i just drop the Fortran option. However, more critical is that i can integrate a scientific graphics package. I certainly have seen MathGL and wondered if anyone has any experience with this and knows how easy it is to integrate into CB?

In terms of scientific graphics packages there is a whole list of many well estabilshed ones under http://en.wikipedia.org/wiki/List_of_information_graphics_software
However, being no expert in these i've no idea how easy it would be to integrate these into the CB IDE, but my priority would be for the opensource packages. Does anyone have any experience in using these with CB and know how easy is to run them from CB?

many thanks,
Neil

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Scientific graphics: 2D plots & 3D surface & contour plots
« Reply #7 on: May 30, 2012, 06:59:30 pm »
I certainly have seen MathGL and wondered if anyone has any experience with this and knows how easy it is to integrate into CB?
I am using it successfully with C::B. And there is no "integration" you use it as any library or SDK you want to use. Just setup the compiler and linker options as needed and you are done.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline _neil_

  • Single posting newcomer
  • *
  • Posts: 3
Re: Scientific graphics: 2D plots & 3D surface & contour plots
« Reply #8 on: February 08, 2014, 09:54:52 pm »
Thanks for help.
Neil