unrelated println statement leads to blank plot
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
研究方向
透過執行模組,並在所述的 Julia、PyPlot、Python 和 matplotlib 版本上呼叫 mxgau(20, .3, .3, .1),重現回報的行為。從 plotresult 和 mxgau 中的 figure 呼叫開始,然後比較有 println 與沒有 println 時的執行結果;完成標準是解釋空白的第三個圖,並驗證三個圖都能正確渲染。
由索引模型根據 Issue 內容生成。
描述
I encountered a strange bug in PyPlot that a println statement in a certain place in my code causes a plot to come out completely blank. Below is a stripped-down version of my code. If I include the code as is, then it makes three plots, but the third plot window is empty. However, if I comment out the println statement on l. 23, then the third plot appears as expected. This is Julia version 1.8.2, PyPlot was just installed today (2022-10-16), python version (according to Pyplot) is 3.9.12, matplotlib version (according to the error message when I type hold(true) at the REPL) is 3.5.2, and the platform is Windows 10.
module driver_ppbug
using LinearAlgebra
using PyPlot
function admm1(a)
n = size(a,2)
clusterID = vcat(ones(Int(n/2)),2*ones(Int(n/2)))
itcount = 1
return clusterID, itcount
end
function find_k_largest_clusters(clusterID, k1)
return vcat([[1,2,3,4], [5,6,7]], [[i] for i = 8 : length(clusterID)])
end
function plotresult(a, clusterID)
n = size(a,2)
colors1 = "rgbcmky"
mxcolor = length(colors1)
result = find_k_largest_clusters(clusterID, mxcolor)
println("result lens = ", [length(q) for q in result])
plotted = [false for i = 1 : n]
for i = 1 : mxcolor
if length(result[i]) > 1
plot(a[1,result[i]], a[2,result[i]], "*" * colors1[[i]])
else
break
end
plotted[result[i]] .= true
end
plot(a[1, .!plotted], a[2, .!plotted], "." * colors1[[mxcolor]])
axis("equal")
nothing
end
function gm_generator(n)
a = hcat(collect(1.0:1.0:n), sin.(1.0:1.0:n))'
compID = vcat(ones(Int(n/2)), 2*ones(Int(n/2)))
weight = ones(n)
return a, compID, weight
end
function mxgau(n, sigma, lambdascale1, lambdascale2)
a, compID, weight = gm_generator(n)
sub1 = findall(compID .== 1)
sub2 = findall(compID .== 2)
close("all")
figure(1)
plot(a[1,sub1], a[2,sub1], "*r")
plot(a[1,sub2], a[2,sub2], "*g")
axis("equal")
figure(2)
plot(a[1,:], a[2,:], "*k")
axis("equal")
clusterID, itcount1 = admm1(a)
figure(3)
plotresult(a, clusterID)
println("itcount1 = ", itcount1)
nothing
end
mxgau(20, .3, .3, .1)
end
- 主要語言
- Julia
- 星號
- 489
- 分支
- 90
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
JuliaPy/PyPlot.jl 的其他 Issue
-
難度 3/5 1-2 天 新手友好度 45/100
-
julia PyPlot support missing data可能已有人在做 @deszoeke 於 668 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 45/100
-
難度 3/5 1-2 天 新手友好度 30/100
-
難度 3/5 1-2 天 新手友好度 35/100
-
難度 4/5 3-5 天 新手友好度 25/100
查看 JuliaPy/PyPlot.jl 的全部 Issue
相似的 Issue
-
documentation
難度 2/5 1-3 小時 新手友好度 62/100
ohno/Antique.jl#165 ·
-
難度 2/5 1-3 小時 新手友好度 62/100
-
難度 2/5 1-3 小時 新手友好度 68/100
grame-cncm/faust#1344 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 70/100
SciML/DiffEqNoiseProcess.jl#342 ·
-
難度 1/5 1 小時以內 新手友好度 88/100