I think I am having issues with my custom function grid conflicting with the Plots package grid .
How can I specify (is “qualify” the better term?) that I want to use my own? To specify Plots’ version, I would do Plots.grid.
I’m having a strange issue where my resulting data changes when I generate a pyplot heatmap - if I comment out the heatmap line, results are correct and consistent after several executions; if I activate it again, results change after every few executions. I checked that this doesn’t happen with GR heatmap. I’ve tried but have not worked out a MWE, so I won’t go too in-depth here.
One solution could be to only import the heatmap function from the Plots package. What would be the syntax if I want the GR heatmap? using Plots.gr.heatmap ?
Another option would be to simply rename my function. Hoping to find a more elegant solution.
If you just use import Plots then you will be forced to prepend all calls to Plots.jl functions with Plot. and I think that will resolve the conflict at the expense of some extra verbosity on your plotting calls.
Instead of always having to write Package. you can create a constant eg. const P = Package. From now on you can use P. instead of Package. if that is too verbose for you.
Yes, but not only. With import, you can now redefine and add methods to functions of the package. For example, I could do
julia> import Plots
julia> Plots.heatmap(x::String) = "This is not a plot"
julia> Plots.heatmap("foo")
"This is not a plot"
julia> Plots.heatmap(x,y,z) = "Broke this one too"
julia> Plots.heatmap(1:10, 1:10, rand(10,10))
"Broke this one too"