Winston.jl icon indicating copy to clipboard operation
Winston.jl copied to clipboard

Add function fimagesc

Open sawcordwell opened this issue 10 years ago • 4 comments

Add a function fimagesc that is equivalent to fplot for imagesc. Specifically, let a colormap be generated for a function f that takes two arguments x and y over specified ranges for x and y.

sawcordwell avatar Jul 22 '15 06:07 sawcordwell

I have an initial version of this function written which I can post for review if it is deemed useful. Thanks

sawcordwell avatar Jul 22 '15 06:07 sawcordwell

I would probably find this very useful.

mvkma avatar Jul 23 '15 22:07 mvkma

I have created a branch for this function https://github.com/sawcordwell/Winston.jl/tree/fimagesc and would like some input. Specifically, what should I do about tests? It seems that not much of Winston is tested, and can it be tested?

Also, fplot uses some algorithm that I haven't looked at in detail yet to create points in some iterative manner. Would that also be a good idea for fimagesc? As a temporary solution I am just using a hard-coded 100 by 100 'resolution'.

sawcordwell avatar Jul 28 '15 04:07 sawcordwell

Nice, thanks!

I think it would be useful to export the 'resolution' as a parameter in fimagesc.

I also fixed a small bug, where typeof(f(xmin, ymin)) returns Int64, but the following values are not integers, so an InexactError is thrown. This happens for example with the following:

f = (x, y) -> x^2 - y^2
fimagesc(f, (-2, 2), (-2, 2))

I copied your branch (is that the right terminology?) and my changes are now here, if you're interested: https://github.com/slangangular/Winston.jl/tree/fimagesc

mvkma avatar Jul 29 '15 14:07 mvkma