Retina+jpeg option?

未關閉
#5 5 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
功能
描述清晰度
需要釐清
活躍度
冷清
技術堆疊
jupyter, jupyter-notebook

研究方向

該 issue 沒有指明來源檔案或測試。首先追蹤 inline backend 如何處理 figure_format 設定和 Retina 尺寸調整,然後將 JPEG 的行為與連結的 Matplotlib issue 和 Stack Overflow 問題進行比較;完成的標準應是有一種定義明確且經過測試的方法,能夠產生尺寸適當的 JPEG notebook 圖片。

由索引模型根據 Issue 內容生成。

描述

I often work with complex matplotlib figures with millions of points, which I've been displaying in my notebooks using the ipython magic %config InlineBackend.figure_format = 'retina'. Unfortunately, these inline images are quite large in terms of file size.

I'm looking for general suggestions on how to reduce the size of my ipynb files, which can grow into the 10s or even hundreds of MB in size and become a bit unwieldy.

One thought I had was to switch to generating jpegs, but while it looks like I can meaningfully reduce the file size by switching the backend to jpeg and increasing the dpi to 2x:

from matplotlib import rcParams
%config InlineBackend.figure_format = 'jpeg'
rcParams['figure.dpi'] = 200

From this repo, it looks like I can dial in jpeg compression values, which should help reduce file size. However, I can't figure out how to size the jpegs appropriately for a retina display (they're twice as large as they should be, and slightly blurry). Is there a way to display jpegs in jupyter notebooks at similar resolution and size to the defaults provided by 'retina' mode?

See also:
Matplotlib issue
Stackoverflow question

主要語言
Jupyter Notebook
星號
31
分支
39
PR 合併指標
30 天內沒有已合併 PR

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

ipython/matplotlib-inline 的其他 Issue

查看 ipython/matplotlib-inline 的全部 Issue

相似的 Issue

更多 Data Visualization Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。