unrelated println statement leads to blank plot
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
調査の方向性
報告された挙動を再現するため、モジュールを実行し、指定された Julia、PyPlot、Python、matplotlib のバージョンで mxgau(20, .3, .3, .1) を呼び出す。plotresult と mxgau 内の figure 呼び出しから始め、その後 println の有無で実行を比較する。空白の3番目の図を説明し、3つすべてのプロットが正しく描画されることを検証できれば完了となる。
索引モデルが 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 にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
oxfordcontrol/COSMO.jl#211 ·
-
documentation
難易度 2/5 半日 初心者へのやさしさ 65/100
メンテナーはふだん 6 日以内に返信
-
Out-of-place JLArray/GPU problem with VectorContinuousCallback scalar-indexes (callback cache built with CPU zeros)対応中かも @ChrisRackauckas-Claude が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
SciML/OrdinaryDiffEq.jl#4813 ·
メンテナーはふだん 1 日以内に返信
-
ARKODE: callbacks that modify `u` throw MethodError on reinit対応中かも @devmotion が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
SciML/Sundials.jl#575 ·