フィルターのクリア

export_fig with transparent background and fixed size?

19 ビュー (過去 30 日間)
Tim Hilt
Tim Hilt 2020 年 2 月 14 日
編集済み: Tim Hilt 2020 年 2 月 14 日
I try to create a .gif with transparent background. This is achieveable by exporting .png figures with transparent background for every frame i want to include in the .gif. This works great with export_fig (export_fig(sprintf('out/sensor1/%03d_sensor1', i), '-transparent', '-png')), however, i think that export_fig only exports the area with filled content, which leads to different image-sizes, because my plots are surf-plots without any axis and with changing content. When i then try to combine them into a transparent .gif with ImageMagick, the different sizes of the single frames lead to a shifting-effect along the y-direction of the animation.
Pythons Matplotlib exports with a fixed figure-size. How can i tell export_fig the specific image-size i want the exported .png graphics to have?

採用された回答

Tim Hilt
Tim Hilt 2020 年 2 月 14 日
編集済み: Tim Hilt 2020 年 2 月 14 日
Somebody should have given me an RTFM: There is the -nocrop-option which enables export_fig to do exactly what i wanted to achieve. I'm calling the function like:
export_fig(sprintf('out/sensor1/%03d_sensor1', i), '-nocrop', '-transparent', '-png')

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by