簡體   English   中英

將包含MATLAB中子圖的圖形以精確尺寸導出為pdf

[英]Export figure containing subplots in MATLAB to pdf in exact dimensions

我在這個問題上苦苦掙扎了很長時間。 我有以下代碼:-

    y = -16.55 : 0.01: 16.55;
    xpos = 10.5361 * cos(y/10.5361) * (pi/20);
    x = [-xpos,xpos];
    y = [y,-y];

    a1 = subplot(1,4,1);
    fill(x,y,'r');

    a2 = subplot(1,4,2);
    fill(x,y,'g');

    a3 = subplot(1,4,3);
    fill(x,y,'o');

    a4 = subplot(1,4,4);
    fill(x,y,'w');

    set(a1,'Units','centimeters','Position',[0 0 5 36]);
    set(a2,'Units','centimeters','Position',[5.5 0 5 36]);
    set(a3,'Units','centimeters','Position',[11 0 5 36]);
    set(a4,'Units','centimeters','Position',[16.5 0 5 36]);

此代碼產生4個子圖。 現在,我需要將整個圖形(不僅僅是屏幕上顯示的圖形)以精確的尺寸(由圖形中的數據光標指向)導出到MATLAB中的pdf。 請提出建議。 我瀏覽了以下鏈接,但沒有太大幫助:-

MATLAB:將圖形打印為pdf,如MATLAB中所示

請提出解決方案。

在matlab中導出數字可能非常痛苦...對我而言,直到我發現了這一點:

http://www.mathworks.com/matlabcentral/fileexchange/23629-export-fig

它以pdf或eps格式導出​​,整個顯示狀態下的圖形(刪除空白邊框)...您嘗試過嗎?

export_fig file_name.pdf完成了!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM