Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem in drawing log function #41

Open
wxie2017 opened this issue Jan 9, 2021 · 3 comments
Open

problem in drawing log function #41

wxie2017 opened this issue Jan 9, 2021 · 3 comments

Comments

@wxie2017
Copy link

wxie2017 commented Jan 9, 2021

Hi,
Thanks for making this tool.

I find that

(cl-ana::draw #'log)

output a straight line, which is not correct.

Please check the attached pdf.
draw-log.pdf

@ghollisjr
Copy link
Owner

Hey sorry for the delay! This is unfortunately something I'm not sure how to handle in a reasonable way. Gnuplot understands how to automatically adjust function sampling given special functions like logarithms which have holes in their domain, but for Gnuplot to know what you're trying to plot, you have to use the text version.

E.g., if you do

(cl-ana::draw "log(x)")

then Gnuplot will know to not include 0 in the domain. However, whenever you want to manually draw a function which has holes in its domain, you will have to manually control the domain. In this case, something like

(cl-ana::draw (line #'log :sampling (list :low 1d-5 :high 3d0 :nsamples 1000)))

would do the trick.

@ghollisjr
Copy link
Owner

I might be able to fix this by adding a filter step before sending data to Gnuplot so that Lisp isn't sending NaNs or infinities.

@wxie2017
Copy link
Author

wxie2017 commented Jan 18, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants