Hi everybody,
I have a fig file and I want to export it as a png, tif or jpeg file. I know how to do this (File - Export Setup). But graphics do not fill the field completely. So when I want to use the file in the word it looks like the following:
I mean, I want to expand my graphics to blue dots as like following:
How can I do this in MATLAB? (The fig. file is attached.)

5 Kommentare

dpb
dpb am 25 Jul. 2020
Did you use subplot or tiledlayout? The latter may give more satisfactory results with less fiddling using the 'TileSpacing','none','Padding','none' named parameters.
NB: I've not tried to see effect if import a subsequent figure into Word--my experiences w/ Word are painful enough to try to avoid anything that needs to be better-looking than whatever it happens to do; generally if try to mung on stuff it just either breaks or makes things worse.
Abdullah Türk
Abdullah Türk am 26 Jul. 2020
I used tiledlayout and tried
tiledlayout(3,3,'Padding','none')
or
tiledlayout(3,3,'TileSpacing','none')
but it does not.
dpb
dpb am 26 Jul. 2020
Bearbeitet: dpb am 26 Jul. 2020
Did you try
tiledlayout(3,3,'Padding','none','TileSpacing','none')
and the options w/ 'compact' as well?
NB: All of these options note they leave room for all the titles, legends, etc., etc., so there's white space going to be there.
Beyond that, you're probably forced into trying to mung on position vectors individually and just see if you can manage to fill up more of the space.
Abdullah Türk
Abdullah Türk am 26 Jul. 2020
I tried
tiledlayout(3,3,'Padding','none','TileSpacing','none')
but it does not. But I do it manually from "Property Inspector" using "POSITION" as follows:
dpb
dpb am 27 Jul. 2020
Yes, but you can do it programmatically -- altho you'll have to work out how much to move which image as the necessary room for the y-axis labels is quite a lot larger for some than others owing to the additional significant digits.
You can do things globally; the following changes all, albeit then they overlap some so you'll need to back off from this extreme...
hF=openfig('untitled.fig'); % get the figure handle -- you should already have or use gcf
hAx=findobj(hF,'type','Axes'); % and get all axes handles
set(hAx,{'Position'},get(hAx,'OuterPosition')) % set all to 'OuterPosition' limits -- no space
As noted, you'll just have to work out how far you can move each and spread them out; the leftmost and rightmost columns can end up with left|left+width at the above limits; the center column may just need to grow a little in width.
I didn't spearmint further...as said, the ones with five digits of precison on y-axis will have to either be narrower than the others or you'll have to replicate the appearance of the original by leaving more space to the left if the axes themselves are to be aligned.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Graphics Object Properties finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 25 Jul. 2020

Kommentiert:

dpb
am 27 Jul. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by