Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

add_callback fails on axis

オープン
#500 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
40/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
julia, python

調査の方向性

まず、PyPlot と ax.xaxis.add_callback エントリーポイントを使って Julia の例を再現し、報告されている Julia バージョン全体で、その動作を Python matplotlib の例と比較します。軸のズーム設定が変更されたときに callback が呼び出され、called log が埋まることで確認できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

I'm trying to set up a callback that runs every time the user changes the zoom setting on an axis. Here's a demo in Python:

>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>> fig, ax = plt.subplots()
>>> ax.plot(np.random.rand(5))
[<matplotlib.lines.Line2D object at 0x7fb3c34266d8>]
>>> def callback(artist):
...     print('callback')
... 
>>> ax.xaxis.add_callback(callback)
0
>>> plt.show()
callback
callback

and then if I click on the magnifying glass and zoom in, I get another callback exactly as expected.

However, here I get nothing:

julia> using PyPlot

julia> PyPlot.version
v"3.3.1"

julia> fig, ax = plt.subplots()
(Figure(PyObject <Figure size 640x480 with 1 Axes>), PyObject <AxesSubplot:>)

julia> ax.plot(rand(5))
1-element Vector{PyCall.PyObject}:
 PyObject <matplotlib.lines.Line2D object at 0x7f5d58079df0>

julia> called = []   # in case there are any task-switching concerns...
Any[]

julia> pushtime(args...) = push!(called, time())  # just log that we got called
pushtime (generic function with 1 method)

julia> ax.xaxis.add_callback(pushtime)
0

and called never gets populated no matter what I do.

Any suggestions? EDIT: true for both Julia 1.5.2 and Julia v"1.6.0-DEV.1187".

主要言語
Julia
スター
489
フォーク
90
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

JuliaPy/PyPlot.jl のほかの issue

JuliaPy/PyPlot.jl の issue をすべて見る

似ている issue

Julia の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。