Skip to content

Pyplot crash on window #575

@StephenVavasis

Description

@StephenVavasis

A short PyPlot program is crashing on my Windows 11 machine (i.e., the Julia REPL exits with no error message). I verified that it works correctly on Linux. This is Julia 1.9.3, PyPlot 2.11.2. The data file br1copy.txt [br1copy.txt](https://github.com/JuliaPy/PyPlot.jl/files/13823984/br1copy.txt) is attached.

module readbr1

using PyPlot

function readbr(filename, stepnum)
    ststepnum = string(stepnum)
    it = zeros(Int,0)
    res1 = zeros(0)
    res2 = zeros(0)
    open(filename, "r") do h
        while true
            p = readline(h)
            s = split(p)
            if length(s) < 12 || s[1] != "step" || s[3] != ststepnum
                if eof(h)
                    break
                else
                    continue
                end
            end
            itnum = parse(Int,s[6])
            push!(it, itnum)
            #println(itnum)
            push!(res1, parse(Float64, s[9]))
            push!(res2, parse(Float64, s[12]))
            if eof(h)
                break
            end
        end
    end
    return it, res1, res2
end

function makeplots(it, res1, res2)
    figure(1)
    clf()
    semilogy(it, res1)
    figure(2)
    clf()
    semilogy(it, res2)
    nothing
end

it, res1, res2 = readbr("br1copy.txt", 6)
makeplots(it, res1, res2)

end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions