3  Inkscapeの使い方

Author

Ryo Nakagami

Published

2025-07-27

Modified

2025-07-27

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 inkscape

MacOSでのインストール

## brew update
brew update

## Inkscapeのインストール
brew install --cask inkscape

Inkscapeの使い方

Inkscape Layout

基本操作

操作 動作内容
ctrl+スクロール zoom up/down
space + マウス objectのcanvas内部の移動

Scatter plotの編集

Example 3.1 marker sizeの一括変更

手順: marker sizeの一括変更
  1. market 1つを選択
  2. Shift + Alt + A(=「Select same object type」)
  3. Ctrl + Shift + Mで「Transform window」へ移動
  4. Scaleタブを開き,好きなサイズに変更する

Resize marker size: Plotly Figure based

Example 3.2 marker colorの一括変更

手順: marker colorの一括変更
  1. market 1つを選択
  2. Select > Fill and Strokeを選択
  3. Ctrl + Shift + F で「Fill and Stroke設定」を開く
  4. RGBAOpacityの設定を実施する

Change datapoint color

ショートカットの設定

  1. Shift + Ctrl + PEdit > Preferencesを開く
  2. Interface > Keyboardを選択
  3. Nameからアサイン対象となる挙動を選択し,Shortcutの組み合わせを入力

shortcut table

動作 shortcut 自作フラグ
Fill and Stroke Shift+Alt+M True
Color and Stroke設定 Ctrl + Shift + F False

References