Plot with customize setting in command line
1 view (last 30 days)
Show older comments
Hello, I have some data which I want to save in various formats using the print function (specifically I have to save them in -dbmp, -depsc, -dsvg and I need to define some properties but that necessarily and obligatorily have to be written on the command line since what I have to do is for a few graphics and I would lose a lot of time with the export setup, among the things I try to achieve is that:
- The width of the figure is 8 cm and the height is automatic depending on the graph
- The background of the figure is white
- The content of the figure is adjusted as much as possible (something similar to what the "expand axes to fill figure" in the export setup does)
I am enclosing a sample image so you can see everything in mine:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/270139/image.bmp)
3 Comments
Jakob B. Nielsen
on 6 Feb 2020
Some of it you can find from the figure documentation; type in doc figure in the command window. Amongst others;
Fig=figure('Color','white','Units','centimeters','Position',[15,10,8,8]);
plot(Fig,yourdatahere);
Will create a figure thats 8x8 cm (the first two arguments are the start point of the lower left corner) and with a white background. I dont know how you would achieve the expand axes effect though.
Answers (0)
See Also
Categories
Find more on Printing and Saving in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!