Remove border around Matlab site

Matlab displays a black border around the plot, and I would like to remove it. I think I should use something like:

set(Figure#,'PropertyName',PropertyValue); 

But I'm not sure what to use PropertyName or PropertyValue ...

Edit:

I tried all the suggestions, including:

 set(gca,'box','off'); set(gca,'xcolor','w','ycolor','w','xtick',[],'ytick',[]); axis off; 

The shape still has a black border and looks like this:

enter image description here

Edit 2: This is a simplified package that reproduces a black box. Run a script called "runPlot". Here: http://dl.dropbox.com/u/8058705/plotTest.zip I can’t understand why the window is still visible. This may be due to the line in "plotTEC.m"

axis([-.65 .6 .25 1.32]) % hardwiring axis length since the coastline runs off of the plot

@Pursuit: If I use the "plot browser" I get a recursive error ... I am not familiar with the Matlab package, but it seems weird. Anyone else get this error? Thank you again for your advice!

Does anyone have any other suggestions?

Thanks in advance!

+8
matlab border figure matlab-figure
source share
4 answers

You want to experiment with axis properties. Some properties of interest.

 xcolor %The color of the x-axis line and the x axis labels ycolor % box %'on', or 'off' indicating if one or both sides of a plot should have lines xtick %Where to place the labels ytick 

For a completely bare schedule, use:

 figure set(gca,'xcolor','w','ycolor','w','xtick',[],'ytick',[]) 

To set the wallpaper to white,

 set(gcf,'color','w') 

Depending on your exact problem, you can try the β€œbox” property to see how it affects your graphs.

 set(gca,'box','on') set(gca,'box','off') 

If you want to disable the actual graph lines, but keep the graph labels, I don’t know a simple solution. I think I will need to remove the axes as described above, and then manually add labels using the text function.


Edit: As I just learned from this question, Plot Overlay MATLAB , you can also try

 axis off axis on 

I think this is equivalent

 set(gca,'visible','off') set(gca,'visible','on') 

Edit 2:

If nothing works, activate the "graphical browser" in the figure. Use "view" β†’ "plot browser". In the chart browser panel, uncheck each object until you find out which object draws the lines that you want to delete.

Then double-click on the abusive object to open the Property Editor panel, and most likely click Advanced Properties to see all the possible properties of this object. From this point of view, you can (hopefully) find out which object draws offensive lines.

After you figure out the object and property for editing, you can probably find out where the object is created in the code, and set the property programmatically.

+14
source share

Try:

 set (gca, 'Box', 'off');
+6
source share

Solution to remove gray background in imagesc

 I = imread('imgname.jpg'); [rows columns] = size(I); posX = 100; posY = 100; %you can set any value for posX and posY - try to keep it on screen f = figure (1); imagesc(I); set(gcf,'Position',[posX posY columns rows]); set(gca,'units','pixels'); set(gca,'units','normalized','position',[0 0 1 1]); axis off; axis tight; 

This should keep the image the same size as the original using imagesc. Hooray!

+3
source share

set (gca, 'Visible', 'off');

0
source share

All Articles