3 Inkscapeの使い方
Inkscapeとは?
- Inkscapeはオープンソースのベクターグラフィック編集ソフト
- Windows,macOS,Linuxで利用可能
- 無料版Adobe Illustratoみたいなもの
Matplotb-generated SVGとの親和性
matplotlibからSVGを出力する場合は
plt.savefig("figure.svg", format="svg", bbox_inches="tight")bbox_inches="tight"で余白を詰めるtransparent=Trueで背景透明化も可能
Axes, legends, font, line, datapointsなどが個別の SVG 要素として表現されるため, Inkscapeでの編集がPlotly-generated SVGと比べて容易というメリットがあります.
Inkscapeのインストール
Linuxでのインストール
## Inkscape PPAの登録
% sudo add-apt-repository ppa:inkscape.dev/stable
% sudo apt update
## Inkscapeのインストール
sudo apt install inkscapeMacOSでのインストール
## brew update
brew update
## Inkscapeのインストール
brew install --cask inkscapeInkscapeの使い方

基本操作
| 操作 | 動作内容 |
|---|---|
ctrl+スクロール |
zoom up/down |
space + マウス |
objectのcanvas内部の移動 |
Scatter plotの編集
Example 3.1 marker sizeの一括変更
手順: marker sizeの一括変更
- market 1つを選択
Shift+Alt+A(=「Select same object type」)Ctrl+Shift+Mで「Transform window」へ移動- Scaleタブを開き,好きなサイズに変更する

Example 3.2 marker colorの一括変更
手順: marker colorの一括変更
- market 1つを選択
Select>Fill and Strokeを選択Ctrl+Shift+Fで「Fill and Stroke設定」を開くRGBAやOpacityの設定を実施する

ショートカットの設定
Shift+Ctrl+PでEdit>Preferencesを開くInterface>Keyboardを選択Nameからアサイン対象となる挙動を選択し,Shortcutの組み合わせを入力
shortcut table
| 動作 | shortcut | 自作フラグ |
|---|---|---|
| Fill and Stroke | Shift+Alt+M |
True |
| Color and Stroke設定 | Ctrl + Shift + F |
False |
References
- Bah (2024)