gujjula / core-plot

Automatically exported from code.google.com/p/core-plot
0 stars 0 forks source link

Plotting Asymptotic graph for tangent function #276

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I want to plot a asymptotic graph for a tangent function.

Please help.

Original issue reported on code.google.com by Manm...@gmail.com on 5 Apr 2011 at 6:58

Attachments:

GoogleCodeExporter commented 9 years ago
Core Plot will not help generate your data. You have to do that yourself.
Just use the tan function to calculate the tangent at different values of x, 
and use the x, y pairs in a CPScatterPlot.

Original comment by drewmcco...@mac.com on 5 Apr 2011 at 7:42

GoogleCodeExporter commented 9 years ago
We are able to generate the data using the tan function.
Also the graph is plotted, but we need it to be asymptotic..
i.e. the dotted lines need to be shown like in the above image.

As its a scatterPlot, all the points are connected using the pattern if 
specified.
But we need to distinguish the line pattern based on the co-ordinates for 
plotting.

Please help.

Original comment by Manm...@gmail.com on 5 Apr 2011 at 1:43

GoogleCodeExporter commented 9 years ago
You should make a separate plot for the asymptotes. Use two points for each 
asymptote, beginning at a large negative number for y, and going to a large 
positive. To avoid lines joining asymptotes, you can return nil. So you could 
have data for the asymptotes like this

x = 0, y = -HUGE_VAL, HUGE_VAL, nil
x = ..., y = -HUGE_VAL, HUGE_VAL, nil

Hope that helps.

Original comment by drewmcco...@mac.com on 5 Apr 2011 at 2:21

GoogleCodeExporter commented 9 years ago
Hi,

Thanks a lot for the reply..

Yes, I can plot the asymptotes using a separate plot, but the main plot which 
plots the tan graph is also plotting the unwanted lines(shown in image below - 
red highlighting).
You suggested to return nil to avoid joining asymptotes, I was not able to find 
the place to return nil..

I just want the top and the bottom points to be avoided from being getting 
connected..

Please help..

Original comment by Manm...@gmail.com on 6 Apr 2011 at 9:03

Attachments:

GoogleCodeExporter commented 9 years ago
You need to figure out where the discontinuities are and insert nil values in 
the data as Drew suggested above for the asymptote plot. The nil value will 
instruct the scatter plot to break the line.

Original comment by eskr...@mac.com on 7 Apr 2011 at 12:27

GoogleCodeExporter commented 9 years ago
Hi All,

Thanks a lot for the valuable comments..
I am done with plotting the graph with asymptotes...

Thanks,
Manmay

Original comment by Manm...@gmail.com on 7 Apr 2011 at 9:58