Recent

Author Topic: contour serie  (Read 3063 times)

apeoperaio

  • Sr. Member
  • ****
  • Posts: 273
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: 1232
    • 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.2.6 | FPC 3.2.2 | PPC, Intel, ARM | macOS, Windows, Linux

wp

  • Hero Member
  • *****
  • Posts: 11916
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 »

apeoperaio

  • Sr. Member
  • ****
  • Posts: 273
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: 11916
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.

 

TinyPortal © 2005-2018