Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!m25g2000vbi.googlegroups.com!not-for-mail
From: ImageAnalyst <imageanalyst@mailinator.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: image in axes: making grid visible
Date: Sun, 1 Nov 2009 19:10:26 -0800 (PST)
Organization: http://groups.google.com
Lines: 25
Message-ID: <ee53d6d4-f5e9-49f2-8e18-cf9cd00c83e1@m25g2000vbi.googlegroups.com>
References: <1187742962.261037.112010@m37g2000prh.googlegroups.com> 
	<1188012165.312218.265130@r23g2000prd.googlegroups.com> <hcgt58$sn9$1@fred.mathworks.com>
NNTP-Posting-Host: 75.186.70.56
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: posting.google.com 1257131426 1596 127.0.0.1 (2 Nov 2009 03:10:26 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 2 Nov 2009 03:10:26 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: m25g2000vbi.googlegroups.com; posting-host=75.186.70.56; 
	posting-account=0rLUzAkAAABojYSRC64DkTbtiSCX77HH
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; 
	GTB6; CyberSafe-IWA-Enable; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 
	3.0.04506.648; .NET CLR 3.5.21022; AskTB5.5),gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:581716


What's the point of saving and then loading it?  You already have g so
that is unecessary.  Your image didn't have a map, so don't use it
subsequently because it's undefined.  Just don't use it.  Try this:

clc;
close all;
clear all;
workspace; % Show the Workspace panel.

% Read in standard monochrome MATLAB demo image.
grayImage = imread('coins.png');
% Threshold it
binaryImage = im2bw(grayImage, 0.4);

% Display the original image.
subplot(1,2,1);
imshow(grayImage);
title('Original gray scale image');

% Display the thresholded, binary logical image.
subplot(1,2,2);
imshow(binaryImage, []); % Note use of [] to scale it so you can see
it.
title('Thresholded (binary) image');
set(gcf, 'Position', get(0, 'ScreenSize')); % Maximize figure.