The two benefits here are that you remove the overhead of MATLAB trying to figure out where to put your plot and also, it prevents MATLAB from having to change which figure is currently displayed, forcing a re-rendering which is one of MATLAB's slowest tasks. The parameter/value approach is widely accepted regardless of whether you're working with a higher level function ( plot, plot3, imshow) or the lower level objects ( line, image, etc.) Functions like plot and plot3 are actually helper functions that wrap the functionality of line and allow for the convention of passing the parent first. The nice thing about this explicit parameter/value specification of the parent is that it is accepted by all graphics objects. f = figure()Īlternately, I prefer the explicit solution im = plot3(X, Y, Z, 'Parent', ax) I tried using set (gcf,'Resize','off') but it's still auto-resizing afterward, but only sometimes randomly. If looks like you attempted to do this in your example, but you provided a handle to a figure rather than an axes. I'm having the same problem using Matlab R2017a on Ubuntu 17.04, where calling for example: figure () set (gcf, 'Position', 0 0 800 400) get (gcf, 'Position') returns 31 11 800 400 or something similar. If you look at the documentation, you will see that you can specify the parent axes as the first parameter to the function. Basically, running the command fig2plotly(gcf, 'offline', true) calls plotlyfig, which calls signin, which loads the config from /.plotly/.config before the 'offline' arg is checked. ![]() #GCF MATLAB 2017 OFFLINE#My preferred way for dealing with this, is to explicitly specify the parent of your plot in the call to plot3. Plotly offline is asking for credentials. While others have provided you exactly what you've asked for (how to make an axes or figure the current one). set(gcf, 'PaperUnits', 'centimeters', 'PaperPosition',0 0 12 12) print -djpeg filename.jpg -r200 Then I am copying this jpeg output into powerpoint to see the effects of modifying -r200 and/or the last argument of the set() function, namely 12 and 12.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |