plot composition: theme(figure_size) ignored in 0.16a3

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

メンテナーはふだん 1 日以内に返信

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

評価

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

調査の方向性

まず、提供されたプロット構成の再現コードを plotnine 0.16a3 で実行し、theme(figure_size) を変化させながら 0.15.3 と比較します。plotnine.composition のエントリーポイントから、構成とテーマ処理を追跡します。リンクされた Compose の例で説明されているとおりに figure_size がレンダリングされた構成のサイズを変更すれば完了です。

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

説明

Documentation Plot Composition Question

I'm trying to reproduce the example, but I can't get the composition to change size.

from plotnine import (
    ggplot,
    aes,
    geom_point,
    geom_boxplot,
    geom_bar,
    geom_smooth,
    facet_wrap,
    labs,
    theme,
    theme_538,
    element_rect,
    element_text,
)
from plotnine import *
from plotnine.composition import plot_spacer
from plotnine.data import mtcars
p1 = ggplot(mtcars, aes("disp", "qsec")) + geom_smooth()
p2 = ggplot(mtcars, aes("wt", "mpg")) + geom_point()
p3 = ggplot(mtcars, aes("factor(gear)", "mpg")) + geom_boxplot()
p4 = ggplot(mtcars, aes("carb")) + geom_bar()

composition = (p1 | (p2 / p3) | p4)

Running

composition + theme(figure_size=(20, 20))

with different values for figure_size always results in the same plot. It works with plotnine 0.15.3.

主要言語
Python
スター
4.8k
フォーク
260
平均マージ
2日 12時間
マージ済み PR(30日)
4

環境構築

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

はじめの一歩

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

has2k1/plotnine のほかの issue

has2k1/plotnine の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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