Recent

Author Topic: contour serie  (Read 2209 times)

apeoperaio

  • Full Member
  • ***
  • Posts: 178
contour serie
« on: November 03, 2014, 11:23:19 am »
Is it possible with TAChart to draw a contour plot?
http://en.wikipedia.org/wiki/Contour_line
Thanks,
Andrea

jwdietrich

  • Hero Member
  • *****
  • Posts: 1133
    • formatio reticularis
Re: contour serie
« Reply #1 on: November 03, 2014, 11:33:31 am »
Depending on your requirements, a ColorMap might be sufficient for your application, see http://wiki.freepascal.org/TAChart_Tutorial:_ColorMapSeries,_Zooming for details. However, a ColorMap isn't the same as a contour plot.

You might therefore consider to define a function series linked to a TParametricCurveSeries handler. With this technique it should be possible to implement a real contour plot. A possible result is the third example at http://wiki.freepascal.org/TAChart_Demos#func.
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 2.0.10 | FPC 3.2.0 | PPC, Intel, ARM | macOS, Windows, Linux

wp

  • Hero Member
  • *****
  • Posts: 7552
Re: contour serie
« Reply #2 on: November 03, 2014, 01:55:23 pm »
Look at this old thread: http://forum.lazarus.freepascal.org/index.php/topic,19399.msg114039.html. It contains a "contour finder" class plus example for TAChart.
« Last Edit: November 03, 2014, 01:57:13 pm by wp »
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

apeoperaio

  • Full Member
  • ***
  • Posts: 178
Re: contour serie
« Reply #3 on: November 05, 2014, 12:17:33 pm »
I had look at the thread, is it implemented in tachart? Since I didn't find ant contour unit in the tachart package.

wp

  • Hero Member
  • *****
  • Posts: 7552
Re: contour serie
« Reply #4 on: November 05, 2014, 01:00:27 pm »
You are right, TAChart does not contain any contour units. But the attachment in one of the postings of the thread contains a complete demo project which shows how you can extend TAChart to draw contours.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

 

TinyPortal © 2005-2018