[julia-users] Re: Iterating over non-zero entries of a sparse matrix

2016-11-09 Thread randmstring
Use findnz .

Am Mittwoch, 9. November 2016 14:37:11 UTC+1 schrieb Christoph Ortner:
>
> Is there as iterator implemented that allows me to iterate over all 
> non-zero entries of a sparse matrix or vector? E.g. 
>
> for (i, j, z) in nonzeros(A) 
>
>
> (I realise that nonzeros does something else!)
>
>

[julia-users] Re: problems (and some fixes) for using Plots and PlotlyJS on FreeBSD

2016-11-08 Thread randmstring
I don't think Electron works on FreeBSD (see here 
), but Blink requires it. 
You could try using the Linux binaries by changing this 
 
line to be is_linux() || is_bsd()and call Blink.AtomShell.install() again, 
but I'm not sure that'll work.

Am Montag, 7. November 2016 21:35:30 UTC+1 schrieb Kostas Oikonomou:
>
> I am using Julia 0.5.0 on FreeBSD 11.  I've had a few problems trying to 
> install the Plots and PlotlyJS packages:
>
> 1. Just after installing Plots, I had to make this fix in
> ~/.julia/v0.5/Plots/src/backends/web.jl, function open_browser_window:
>
>@static if is_linux() || is_bsd()
> return run(`xdg-open $(filename)`)
>end
>
> 2. Now trying to install PlotlyJS.  HttpParser doesn't build, because in
> BinDeps.jl, function unpack_cmd(...), says
>
>elseif extension == ".zip"
>return (`unzip -x $file -d $directory`)
>
> The /usr/bin/unzip on FreeBSD doesn't understand "-x" (more precisely, it 
> thinks
> it means "exclude").  GNU gunzip doesn't understand it either.  What 
> "unzip" is
> this supposed to be?  I made an ugly hack to work around this.
>
>
> 3. In ~/.julia/v0.5/Blink/src/AtomShell/process.jl: I had to add is_bsd() 
> to
>
> @static if is_apple()
>   const _electron = resolve("Blink", 
> "deps/Julia.app/Contents/MacOS/Electron")
> elseif is_linux() || is_bsd()
>   const _electron = resolve("Blink", "deps/atom/electron")
> elseif is_windows()
>   const _electron = resolve("Blink", "deps", "atom", "electron.exe")
> end
>
> 4. After all this, I still get the error:
>
> julia> using Plots
> julia> plotlyjs()
> julia> plot(x -> x^2, rand(10))
> Error showing value of type Plots.Plot{Plots.PlotlyJSBackend}:
> ERROR: Cannot find Electron. Try `Blink.AtomShell.install()`.
>  in electron() at 
> /usr/home/ko/.julia/v0.5/Blink/src/AtomShell/process.jl:53
>
>
> Thanks for any help.
>
> Kostas
>


[julia-users] Re: Overload what to fix "Julia Client - Internal Error" with subtype of AbstractArray?

2016-09-29 Thread randmstring
That error happens because your subtyping isn't entirely correct:

IsModifiedArray{Float64, 1} <: AbstractArray{Float64, 1} == false

with your definition. If you do 

abstract SpecialArray{T,S} <: AbstractArray{T,S}
type IsModifiedArray{T,S} <: SpecialArray{T,S}
  values :: Array{T,S}
  ismodified :: Bool
end

you won't get that error. 

If you want to pretty print results in Juno that won't be enough: Have a 
look here .

Am Donnerstag, 29. September 2016 14:44:52 UTC+2 schrieb Chris Stook:
>
>
> I have defined a simple subtype of AbstractArray which keeps track if an 
> array has been modified by the user.  Base.show, Base.showcompact, and 
> Base.display are overloaded.  This works in the REPL, but with Atom I 
> receive the following error.
>
> Julia Client - Internal Error
>
> MethodError: no method matching 
> print_matrix(::IOContext{Base.AbstractIOBuffer{Array{UInt8,1}}}, 
> ::LTspice.IsModifiedArray{Float64,1}, ::String, ::String, ::String)
> Closest candidates are:
>   print_matrix(::IO, 
> !Matched::Union{AbstractArray{T,1},AbstractArray{T,2}}, ::AbstractString, 
> ::AbstractString, ::AbstractString) at show.jl:1379
>   print_matrix(::IO, 
> !Matched::Union{AbstractArray{T,1},AbstractArray{T,2}}, ::AbstractString, 
> ::AbstractString, ::AbstractString, !Matched::AbstractString) at 
> show.jl:1379
>   print_matrix(::IO, 
> !Matched::Union{AbstractArray{T,1},AbstractArray{T,2}}, ::AbstractString, 
> ::AbstractString, ::AbstractString, !Matched::AbstractString, 
> !Matched::AbstractString) at show.jl:1379
>   ...
>  in #showarray#330(::Bool, ::Function, 
> ::IOContext{Base.AbstractIOBuffer{Array{UInt8,1}}}, 
> ::LTspice.IsModifiedArray{Float64,1}, ::Bool) at .\show.jl:1618
>  in verbose_show(::Base.AbstractIOBuffer{Array{UInt8,1}}, 
> ::MIME{Symbol("text/plain")}, ::LTspice.IsModifiedArray{Float64,1}) at 
> .\multimedia.jl:50
>  in #sprint#304(::Void, ::Function, ::Int64, ::Function, 
> ::MIME{Symbol("text/plain")}, ::Vararg{Any,N}) at .\strings\io.jl:37
>  in Type at C:\Users\Chris\.julia\v0.5\Juno\src\types.jl:48 [inlined]
>  in Type at C:\Users\Chris\.julia\v0.5\Juno\src\types.jl:49 [inlined]
>  in render(::Juno.Editor, ::LTspice.IsModifiedArray{Float64,1}) at 
> C:\Users\Chris\.julia\v0.5\Juno\src\types.jl:12
>  in (::Atom.##81#84)(::Dict{String,Any}) at 
> C:\Users\Chris\.julia\v0.5\Atom\src\eval.jl:64
>  in handlemsg(::Dict{String,Any}, ::Dict{String,Any}, 
> ::Vararg{Dict{String,Any},N}) at 
> C:\Users\Chris\.julia\v0.5\Atom\src\comm.jl:148
>  in (::Atom.##7#10)() at .\event.jl:68
>
>
> What do I need to overload to fix this?
>
> Code below:
>
> abstract SpecialArray <: AbstractArray
>
> Base.size(a::SpecialArray) = size(a.values)
> Base.linearindexing{T<:SpecialArray}(::Type{T}) = Base.LinearFast()
> Base.getindex(a::SpecialArray, i::Int) = a.values[i]
> Base.ndims(a::SpecialArray) = ndims(a.values)
> Base.show(io::IO, a::SpecialArray) = show(io,a.values)
> Base.showcompact(io::IO, a::SpecialArray) = showcompact(io,a.values)
> Base.display(a::SpecialArray) = display(a.values)
> """
> Same as Array, but tracks is user has modified values.
> """
> type IsModifiedArray{T,S} <: SpecialArray
>   values :: Array{T,S}
>   ismodified :: Bool
> end
>
> function Base.setindex!(a::IsModifiedArray, v, i::Int)
>   a.ismodified = true
>   a.values[i] = v
> end
>
> a =  IsModifiedArray{Float64,1}([1.0,2.0,3.0],false) # error here
>
>

[julia-users] Re: Error when assigning values to an object

2016-09-16 Thread randmstring
Sure, just export what you want available when using your Module -- that's 
useful anyways for defining a public API. Also have a look at the Julia 
documentation , 
which describes all that pretty nicely.

Am Freitag, 16. 
September 2016 14:04:02 UTC+2 schrieb varu...@gmail.com:
>
> Oh, thanks so much! It fixed my problem. But, is there a way to just write 
> PhyNode(blah, blah, blah) instead of the cumbersome MyClasses.PhyNode ? I 
> tried using MyClasses and it reported the same error as well.
>
> On Friday, 16 September 2016 12:11:18 UTC+2, randm...@gmail.com wrote:
>>
>> The error I'm getting is something like 
>>
>> ERROR: LoadError: UndefVarError: PhyNode not defined
>>
>> So since you used importall instead of using, you need to the qualified 
>> MyClasses.PhyNode. If you do, you'll probably get some error about
>>
>> ERROR: LoadError: MethodError: `convert` has no method matching 
>> convert(::Type{MyClasses.PhyNode{T}}, ::Int64, ::ASCIIString, ::Float64, 
>> ::Float64)
>>
>> unless you have another constructor for PhyNode, since you need to 
>> provide the two vectors for inEdges and outEdges as well. Long story 
>> short: Something like 
>>
>> push!(nodelist, MyClasses.PhyNode(1, Atlanta, 32.3, 54.7, [], []))
>>
>> should work, though you should probably specify the type and maybe size 
>> of the vectors (depending on what you want to do with them).
>>
>> Am Freitag, 16. September 2016 10:02:08 UTC+2 schrieb varu...@gmail.com:
>>>
>>> The files are indeed in the same directory and I also added the path of 
>>> these files to the variable LOAD_PATH as well. But still, I get the same 
>>> error.
>>>
>>> On Friday, 16 September 2016 09:49:45 UTC+2, Lutfullah Tomak wrote:

 It is related to the `importall` part of code. It can be that the files 
 are not in the same directory but I'm not sure. Also, [] creates an Array 
 with element type of Any. Giving it a type annotation may help peeformance 
 ei TypeofArray[].
>>>
>>>

[julia-users] Re: Error when assigning values to an object

2016-09-16 Thread randmstring
The error I'm getting is something like 

ERROR: LoadError: UndefVarError: PhyNode not defined

So since you used importall instead of using, you need to the qualified 
MyClasses.PhyNode. If you do, you'll probably get some error about

ERROR: LoadError: MethodError: `convert` has no method matching 
convert(::Type{MyClasses.PhyNode{T}}, ::Int64, ::ASCIIString, ::Float64, 
::Float64)

unless you have another constructor for PhyNode, since you need to provide 
the two vectors for inEdges and outEdges as well. Long story short: 
Something like 

push!(nodelist, MyClasses.PhyNode(1, Atlanta, 32.3, 54.7, [], []))

should work, though you should probably specify the type and maybe size of 
the vectors (depending on what you want to do with them).

Am Freitag, 16. September 2016 10:02:08 UTC+2 schrieb varu...@gmail.com:
>
> The files are indeed in the same directory and I also added the path of 
> these files to the variable LOAD_PATH as well. But still, I get the same 
> error.
>
> On Friday, 16 September 2016 09:49:45 UTC+2, Lutfullah Tomak wrote:
>>
>> It is related to the `importall` part of code. It can be that the files 
>> are not in the same directory but I'm not sure. Also, [] creates an Array 
>> with element type of Any. Giving it a type annotation may help peeformance 
>> ei TypeofArray[].
>
>

[julia-users] Re: Julia Low Pass Filter much slower than identical code in Python ??

2016-09-12 Thread randmstring
The Julia code takes 0.000535 seconds for me on the second run -- during 
the first run, Julia has to compile the method you're timing. Have a look 
at the performance tips 

 
for a more in depth explanation.
 
Am Montag, 12. September 2016 11:53:01 UTC+2 schrieb MLicer:
>
> Dear all,
>
> i've written a low-pass filter in Julia and Python and the code in Julia 
> seems to be much slower (*0.800 sec in Julia vs 0.000 sec in Python*). I 
> *must* be coding ineffieciently, can anyone comment on the two codes 
> below?
>
> *Julia:*
>
>
> 
> using PyPlot, DSP
>
> # generate data:
> x = linspace(0,30,1e4)
> sin_noise(arr) = sin(arr) + rand(length(arr))
>
> # create filter:
> designmethod = Butterworth(5)
> ff = digitalfilter(Lowpass(0.02),designmethod)
> @time yl = filtfilt(ff, sin_noise(x))
>
> Python:
>
> from scipy import signal
> import numpy as np
> import cProfile, pstats
>
> def sin_noise(arr):
> return np.sin(arr) + np.random.rand(len(arr))
>
> def filterSignal(b,a,x):
> return signal.filtfilt(b, a, x, axis=-1)
>
> def main():
> # generate data:
> x = np.linspace(0,30,1e4)
> y = sin_noise(x)
> b, a = signal.butter(5, 0.02, "lowpass", analog=False)
> ff = filterSignal(b,a,y)
>
> cProfile.runctx('filterSignal(b,a,y)',globals(),{'b':b,'a':a,'y':y},
> filename='profileStatistics')
>
> p = pstats.Stats('profileStatistics')
> printFirstN = 5
> p.sort_stats('cumtime').print_stats(printFirstN)
>
> if __name__=="__main__":
> main()
>
>
> Thanks very much for any replies!
>


[julia-users] Re: [HELP] Doubts in Julia Language with Strings.. I've condensed my doubts into one Simple Program

2016-08-24 Thread randmstring
Note that the above solutions won't work if your input happens to be 
non-ascii -- g's code will give something like "3:3-5:2-4:�-�" as the 
output for "abcabü".

Imho it's better to build the string you want in the end from scratch 
instead of treating it as a mutable object:

input = "abcabü"

tmp = IOBuffer()
ind = 1
for char in input
  if isodd(ind)
print(tmp, Int(char) + 2 - Int('a') + 1 )
ind == length(input) || print(tmp, ':')
  else
print(tmp, Int(char) + 1 - Int('a') + 1)
ind == length(input) || print(tmp, '-')
  end
  ind += 1
end

out = takebuf_string(tmp)

This will give you a sensible result even for unicode input 
("3:3-5:2-4:157" in the case I mentioned above).


Am Mittwoch, 24. August 2016 16:35:58 UTC+2 schrieb Rishabh Raghunath:
>
> *Hello Julia Users !!..*
>
> I have asked this question before in the forum but am still a bit unclear 
> on how to do the below.. I have condensed a few of my doubts in the 
> question below.
>
> Being from a C background where strings are just character Arrays, 
> manipulating individual characters using the array index was easy.. However 
> In julia that definitely does not seem to be the recommended way to go 
> about doing things and I have a lot of doubts about the small details on 
> the language. Here's a small example of what I am trying to achieve with my 
> program .. This is a fairly simple program while doing it in C but I have 
> absolutely no idea how to implement the same in Julia as strings cannot be 
> treated like character arrays and i cannot just  increment an index of the 
> string to increase the ASCII value of the character in Julia. Please try to 
> solve the problem or guide me on how to implement this in Julia.. I promise 
> the question is very simple and isn't as complex as It may seem at a 
> glance. 
>
> *My Aim*:
>
> To write a program a program which accepts a string via the input 
> and encrypts it to the following simple algorithm ..
>
> *Algorithm:*
>
> *Example Input String: abcabc*
>
> 1. Increase the ASCII value of the character at the *ODD index* of the 
> string  by 5 steps( example increased the ASCII value of '  *a*  ' by 2 
> thus making it   ' * c*  '  
> 2. Increase the ASCII value of the character at the *EVEN index* of the 
> string  by 1 step( example increased the ASCII value of ' * b*  ' by 1 
> thus making it   '  *c*  '
> 3. Print the new encrypted string on Screen. I need it stored in a new 
> string variable say z *(OUTPUT : ccebdd  )*
> 3. Insert a ' - ' between each pair of characters of the string and store 
> in new string in another string variable say y.
> 4. Print string y on the screen  * (OUTPUT : cc-eb-dd  ) *
> 5. Change all the characters in the string into its number equivalent. ( 
> a=1,b=2,c=3,.) and separate the numbers representing each character by 
>  '  :  ' 
> 6. Store the new string from the above operation in variable v and print v 
>  *(OUTPUT : 3:3-5:2-4:4)*
>
> Guys .. Try to help me out !!.. I tried searching everywhere on the 
> internet for steps in doing the above operations in Julia but haven't found 
> anything.. I always get the index errors for treating Julia the C way.. 
> Please try to create a program that does the above.. Just so that Its 
> easier for me to understand what you are doing in the program rather than 
> type the directives in English and then later misunderstanding stuff... I 
> need to learn doing the above procedure the right way without messing with 
> stuff like using indexes in strings for character manipulation that may get 
> deprecated in the future..
>
> Thanks !! Waiting eagerly for a reply !!  
>
>

[julia-users] Re: Why does julia use END for block end?

2016-05-07 Thread randmstring
Also, since you're using Atom you could just edit your stylesheet (go to 
Settings => Themes and click the link at the top) to include something like

atom-text-editor::shadow .keyword.control.end.julia {
  color: gray;
}

which would make the end a bit more subtle.

Am Freitag, 6. Mai 2016 20:26:15 UTC+2 schrieb Ford Ox:
>
> Is there any reasoning behind it? It seems to me like a weird choice since 
> you have to type three letters, which is the complete opposite of the goal 
> of this language - being very productive (a lot work done with little code).
> On top of that, brain has to read the word every time your eyes look at it 
> so you spend more time also reading the code - tho this should be easy to 
> omit, by highlighting this keyword by other color than other keywords (the 
> current purple color in ATOM just drives me crazy, since it is one of the 
> most violent colors, so my eyes always try to read that useless piece of 
> information first, instead of the important code).
>


[julia-users] Re: Installation Problem

2016-04-26 Thread randmstring
Hi,

there's no problem with the installation of either Atom or Juno or Julia, 
it's just that your home dir seems to be on a network drive and that 
doesn't play well with Julia's package manager. You could try setting the 
JULIA_PKGDIR environement variable to a folder on a local hard drive and 
then call Pkg.init() 
.
 
After that, adding packages should work just like that. 

Am Dienstag, 26. April 2016 03:05:27 UTC+2 schrieb Nadir:
>
> Hi,
>
> I tried to install Juno,when trying to add uber-juno in Atom, I get the 
> following message:
>
> Go to the Packages → Julia → Open Terminal menu and
> run `Pkg.add("Atom")` in Julia, then try again.
> If you still see an issue, please report it to:
> julia...@googlegroups.com 
>
> After trying to add the package manually in the shell, I get the following 
> message after 30 mins ...
>
>
> julia> Pkg.add("Atom")
> INFO: Initializing package repository Q:\.julia\v0.4
> INFO: Cloning METADATA from git://github.com/JuliaLang/METADATA.jl
> fatal: The remote end hung up unexpectedly
> ERROR: failed process: Process(`git clone -q -b metadata-v2 git://
> github.com/Jul
> iaLang/METADATA.jl METADATA`, ProcessExited(128)) [128]
>  in run at process.jl:531
>
> julia>
>
> Is this a problem on my end/in my installation of atom?
>
> Thanks for your help and consideration.
>


[julia-users] Re: I am Getting problem with julia and light table to work them together

2016-03-19 Thread randmstring
Hi Tanveer,

the Julia plugin for LightTable isn't maintened anymore. Recent work has 
focussed on getting Julia nicely integrated into Atom -- you can find the 
install instructions for that here 
. There's 
also a nice piece on the Juno workflow and how it differs from the usual 
REPL workflow here 

.

Best,
Sebastian

Am Dienstag, 15. März 2016 15:07:27 UTC+1 schrieb tann...@gmail.com:
>
> Hello,
>
> I installed julia and light table is also connect with julia.But I dont 
> know how to run code of light table on julia.Or we can say that how to make 
> them on work together.
> Thank you for your time 
>
> BR,
> Tanveer
>


[julia-users] Re: Julia and Atom

2016-03-08 Thread randmstring
Hi, 

if you are using Juno (and therefore ink), this is this 
 issue. Will most probably 
be fixed on the next release (also see this PR 
).

Regards,
Sebastian

Am Dienstag, 8. März 2016 19:35:36 UTC+1 schrieb Uwe Fechner:
>
> Hello,
>
> I gave Atom a try.
>
> One question: When I close Atom and restart it it doesn't remember the 
> window size.
>
> Is it possible to convince Atom to start with a wider window?
>
> Best regards:
>
> Uwe
>


[julia-users] Re: Atom inline evaluation shortcut

2015-12-12 Thread randmstring
Shift-Enter for evaling and jumping to the next executable block of code 
hasn't been implemented yet in Juno/Atom. See 
https://github.com/JunoLab/atom-julia-client/issues/24 and its dependency 
https://github.com/JunoLab/atom-julia-client/issues/9 .

Am Samstag, 12. Dezember 2015 14:37:34 UTC+1 schrieb Sisyphuss:
>
> After experience, this command evaluates all codes.
> Furthermore, it doesn't put the feedback inline.
>
> On Saturday, December 12, 2015 at 2:31:25 PM UTC+1, Eric Forgy wrote:
>>
>> Try Cntrl + Shift + Enter
>
>

[julia-users] Re: How does 'find_library' works?

2015-11-17 Thread randmstring

julia> find_library(["libgmt.dylib"],["/Users/j/programs/gmt5/lib"])

should do the trick. The docs at least imply that both arguments should be 
vectors -- for one because of the plural and locations is supposed to be a 
list.

Am Dienstag, 17. November 2015 15:24:38 UTC+1 schrieb J Luis:
>
> The doc 
> 
>
> julia> find_library("libgmt.dylib","/Users/j/programs/gmt5/lib")
> ERROR: MethodError: `find_library` has no method matching 
> find_library(::ASCIIString, ::ASCIIString)
> you may have intended to import Base.find_library
>  in find_library at deprecated.jl:32
>
> julia> Libdl.find_library("libgmt.dylib","/Users/j/programs/gmt5/lib")
> ERROR: MethodError: `find_library` has no method matching 
> find_library(::ASCIIString, ::ASCIIString)
> you may have intended to import Base.find_library
>
> julia> Base.find_library("libgmt.dylib","/Users/j/programs/gmt5/lib")
> ERROR: MethodError: `find_library` has no method matching 
> find_library(::ASCIIString, ::ASCIIString)
> you may have intended to import Base.find_library
>  in find_library at deprecated.jl:32
>
>
> julia> Libdl.find_library(libgmt.dylib,"/Users/j/programs/gmt5/lib")
> ERROR: UndefVarError: libgmt not defined
>
> (but it is there)
>
> Thanks
>


[julia-users] Re: Why is the type of a variable different from inside and outside a let block?

2015-07-21 Thread randmstring
Surprising it may be, but also sensible. An assignment always returns the 
assigned value, not the variable it is assigned to:

let
x::Float64 = 5
x
end::Float64

I think there's something in the docs that describes that behaviour, but I 
can't seem to find it right now...

Am Dienstag, 21. Juli 2015 06:03:03 UTC+2 schrieb Ismael VC:

 This was surprising:

 julia versioninfo()
 Julia Version 0.4.0-dev+5491
 Commit cb77503 (2015-06-21 09:45 UTC)
 Platform Info:
   System: Linux (x86_64-unknown-linux-gnu)
   CPU: Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
   WORD_SIZE: 64
   BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
   LAPACK: libopenblas
   LIBM: libopenlibm
   LLVM: libLLVM-3.3

 julia let
x::Float64 = 5
end::Float64
 ERROR: TypeError: typeassert: expected Float64, got Int64

 julia let
x::UTF8String = test
end::UTF8String
 ERROR: TypeError: typeassert: expected UTF8String, got ASCIIString




[julia-users] Re: 2D plot in gadfly

2015-03-03 Thread randmstring
Nope, you can also use rectangular pixels:

using Gadfly

Xmin = Float64[]
Xmax = Float64[]
Ymin = Float64[]
Ymax = Float64[]
Z = Float64[]

for x in 1:2:30, y in 1:20
push!(Xmin,x-1)
push!(Ymin,y-0.5)
push!(Xmax,x+1)
push!(Ymax,y+0.5)
push!(Z,x*y)
end

plot(x_min=Xmin, x_max=Xmax, y_min=Ymin, y_max=Ymax, color=Z, Geom.rectbin)

Not pretty, but it works. There's also spy(arr), but I'm not sure what the 
options are there.


Am Dienstag, 3. März 2015 16:02:43 UTC+1 schrieb Andrei Berceanu:

 But Geom.rectbin seems to only work for square arrays, which is a severe 
 limitation.

 On Saturday, February 7, 2015 at 12:44:26 AM UTC+1, Iain Dunning wrote:

 How about:

 using Gadfly
 # Generate some data
 N = 100
 X = Float64[]
 Y = Float64[]
 Z = Float64[]
 for x in linspace(0.0,2π,N), y in linspace(0.0,2π,N)
 push!(X, x)
 push!(Y, y)
 push!(Z, sin(x)*sin(y))
 end
 plot(x=X,y=Y,color=Z,Geom.rectbin)



 On Friday, February 6, 2015 at 5:34:45 PM UTC-5, Andrei Berceanu wrote:

 The only thing keeping me from migrating from PyPlot to Gadfly is the 
 lack of 2D plotting abilities. To exemplify, I used the following code to 
 generate the attached image with PyPlot (here data is a 2d array):


















 *fig, ax = plt.subplots(figsize=(4, 4))img = ax[:imshow](data, 
 origin=upper, ColorMap(hot), 
 interpolation=none,   
 extent=[x[1], x[end], x[1], x[end]]) ax[:set_ylim](x[1], 
 x[end]) ax[:set_xlim](x[1], 
 x[end]) ax[:set_xlabel](L$p_x$) ax[:set_ylabel](L$p_y$) tks = [-3., 
 -1.5, 0, 1.5, 
 3.] ax[:xaxis][:set_ticks](tks) ax[:yaxis][:set_ticks](tks) cbar = 
 fig[:colorbar](img, shrink=0.8, aspect=20, 
 fraction=.12,pad=.02) cbar[:ax][:tick_params](labelsize=7) 
 fig[:savefig](fig_berry_bz, 
 bbox_inches=tight)*

 What is the current alternative for obtaining such a plot using Gadfly? 
 Are there plans for getting similar functionality anytime soon?



[julia-users] Path separator on Windows

2014-09-15 Thread randmstring
Hello all,

I recently encountered an issue 
https://github.com/JuliaLang/Tk.jl/issues/62#issuecomment-55392934 with 
path separators on Windows and was wondering why backslashes were chosen 
over slashes in Julia Base. Windows usually interprets / just as well as 
\, especially if the paths are quoted. Something like

shell pushd C:/users

works fine, although 

shell pushd C:/users

does not, which might prove problematic (but then again, paths for cmd.exe 
should be quoted anyways because of the bad escaping of  ). One might 
consider changing the separator to a slash which might reduce compatibility 
issues as well as (hopefully) make most of the special @windows_only cases 
in base/path.jl obsolete. As a bonus, the regexps wouldn't look all that 
crazy anymore :)

So, my question is: Are there problems with that approach? And if I wanted 
to try to implement that, how would I go about it? As far as I can see, 
Julia needs to be recompiled for changes in base to take effect, correct?

Oh, btw, thanks for this great language. It's really nice to see Julia come 
along and get better and better by every release! :)