Allow 'ultraplot'-style figure sizing options
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- data-visualization
Hướng nghiên cứu
Bắt đầu bằng cách so sánh hai cách tiếp cận về việc định cỡ được mô tả trong tài liệu Ultraplot được liên kết với các tùy chọn width, height, unit và dpi hiện tại của ggsave trong LetsPlot. Sử dụng các ví dụ facet_grid và heatmap làm trường hợp nghiệm thu; được xem là hoàn tất khi kích thước hình có thể tăng để phù hợp với kích thước của subplot hoặc phần tử mà không cần ước lượng chiều cao thủ công.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
A frequent source of annoyance when using matplotlib or ggplot is the need to specify the dimensions of the entire figure. After that, the figure is subdivided into axes, labels, etc. This makes it difficult to control the appearance of the figure and often results in guess-and-check tweaking of the figure size, which is doable for static figures but practically impossible to get right if figures are dynamically generated under a fairly wide range of conditions.
The library ultraplot builds on top of matplotlib and notably it enables users to specify figure sizing in a more natural way. There are two main options (to my understanding):
- Specify the width of the figure and the aspect ratios of the subplots. The figure height is then grown to accommodate the figure elements.
- Specify the size of the subplots. The figure height and width is then grown to accommodate the figure elements.
The ultraplot documentation describes this in a little more detail.
There are many cases where this is useful. For example, if I use facet_grid with n rows, then I typically want to describe the shape of a row and have the figure be as tall as needed to accommodate all n rows. In matplotlib or ggplot, you have to change height manually to do this and often I end up trying to guesstimate some formula like height = 100 + 200*n. Another example is a heatmap where you want to set the size of individual cells which is easy to do by setting the subplot widths and heights but is very difficult to do by setting the figure width and height because the space needed for row/column labels and colorbars isn't known in advance. Setting the aspect ratio of the heatmap typically results in whitespace surrounding the plot, such as this:
import numpy as np
import lets_plot as lp
import polars as lp
i,j = np.meshgrid(np.arange(10), np.arange(100))
data = pl.DataFrame({
'x': i.flatten(),
'y': j.flatten(),
'z': np.random.random(size=i.flatten().shape[0]),
})
p1 = (lp.ggplot(data, lp.aes(x='x', y='y',fill='z'))
+ lp.geom_tile()
+ lp.coord_fixed(ratio=1)
)
lp.ggsave(p1, "out.png", w=5, h = 10, unit='in', dpi=70)# what should I pick for h so that I fill the desired width?
As far as I know, LetsPlot does not have support for this. Adopting the figure size specification options of ultraplot would significantly address this difficulty.
- Ngôn ngữ chính
- Kotlin
- Star
- 1.8k
- Fork
- 63
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của JetBrains/lets-plot
-
SyntaxWarning upon library importCó thể đã có người làm @Shriraj1901 đã nhận 12 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 57/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 67/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 62/100
Tất cả issue của JetBrains/lets-plot
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
AlfaazPlus/QuranApp#752 · 2 bình luận ·
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
theopenconversationkit/tock#2148 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
music-assistant/mobile-app#1393 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Improve browser4-cli --help.Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 67/100