Rank: 1020 based on 68 downloads (last 30 days) and 1 file submitted
photo

Brandon Levey

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Brandon
Updated   File Tags Downloads
(last 30 days)
Comments Rating
03 Jul 2011 Screenshot Hatch fill patterns plus Color & Invert Updated code hatch with color and inverted hatches Author: Brandon Levey bar, color, hatch, plot, inverted hatch, replacement 68 3
  • 4.75
4.8 | 4 ratings
Comments and Ratings on Brandon's Files View all
Updated File Comment by Comments Rating
01 Mar 2011 Hatch fill patterns plus Color & Invert Updated code hatch with color and inverted hatches Author: Brandon Levey Lee, Sungeun
18 Oct 2010 Hatch fill patterns plus Color & Invert Updated code hatch with color and inverted hatches Author: Brandon Levey costa, valantis
02 Nov 2009 Hatch fill patterns plus Color & Invert Updated code hatch with color and inverted hatches Author: Brandon Levey Stefan

Does just what I was looking for!

01 Oct 2009 Hatch fill patterns plus Color & Invert Updated code hatch with color and inverted hatches Author: Brandon Levey Planchon, Olivier

Bug Report :
the image generated has twice the number of rows, and columns (thus 4 times the weight) than expected by the defined size and image position.
as a result, Fonts in the result files are half the desired size. See at the end of my comment a file that demonstrates this bug.

Other comments :
This is a convenient workaround to create hatched graphichs.
input is a color graphic (either a matalb figure or an image file).
Output is a hatched graphic where each color area was changed into hatches.

I do not feel comfortable with the last two parameters (scales) because they are relative. Absolute line width and spacing would be better imho (perhaps this is possible and I missed something).

bug demo file :

txt = {'Police 6 1a23b45c67d89e0. ' ; 'Police 8 1a23b45c67d89e0. '; 'Police 10 1a23b45c67d89e0. '; 'Police 12 1a23b45c67d89e0. '} ;

% définit figure vide
fghl = figure(1) ;
clf % clear figure
hold off
set (fghl, 'PaperUnits', 'centimeters') % unité de papier
set (fghl, 'Units', 'centimeters') % unités d'écran (marche pas vraiment ...
figure_margins = [1 1] ; % En cm : position = 1 cm du coin BG de l'image,
figure_size = [8.5 5] ;% taille = largeur x hauteur, en cm.
set (fghl, 'PaperType', 'A4', 'PaperPosition', [figure_margins figure_size])
set (fghl, 'Position', [figure_margins 2*figure_size])
whitebg(fghl, 'white') ; % white back ground

% Les traits et les polices
ligne.hair = 0.5 ;
ligne.normal = 1 ;
ligne.semibold = 1.5 ;
ligne.bold = 2 ;

fontsize = [6 8 10 12] ;

hold on
plot([0 1 2], [0 1 4], 'k', 'linewidth', ligne.normal) ;
t = (1/16:1/8:1)'*2*pi;
x = sin(t);
y = cos(t);
fill(x,y,'r')
axis equal

x0a = [0 0 0 0] ;
y0a = 1.5:-0.2:0 ;
x0b = -1 ;
y0b = 3 ;
for i = 1:4
text(x0a(i), y0a(i), txt(i), 'fontsize', fontsize(i))
end

txt2 = [] ;
for i=1:4
    t = txt{i} ;
    txt2 = [txt2 '\fontsize{' num2str(fontsize(i)) '}' t] ;
end
text(x0b, y0b, txt2) ;

drawnow

% Transforme les couleurs en hachurage
dpi = 72

% Sauve la figure
dpitag = ['-r' num2str(dpi)] ;
print('-dtiffn',dpitag ,'test1.tiff') ; % This file is correct

[im_hatch, colorlist] = applyhatch_pluscolor(gcf,'\/',0,0,[],dpi,5,5);
imwrite(im_hatch,'test2.tiff','tiff', 'Resolution', dpi) % this file is too large.

30 Sep 2009 Hatch fill patterns plus Color & Invert Updated code hatch with color and inverted hatches Author: Brandon Levey Planchon, Olivier

This is a convenient workaround to create hatched graphichs.
input is a color graphic (either a matalb figure or an image file).
Output is a hatched graphic where each color area was changed into hatches.

I do not feel comfortable with the last two parameters (scales) because they are relative. Absolute line width and spacing would be better imho (perhaps this is possible and I missed something).

Top Tags Applied by Brandon
bar, color, color hatch, figure, hatch
Files Tagged by Brandon
Updated   File Tags Downloads
(last 30 days)
Comments Rating
03 Jul 2011 Screenshot Hatch fill patterns plus Color & Invert Updated code hatch with color and inverted hatches Author: Brandon Levey bar, color, hatch, plot, inverted hatch, replacement 68 3
  • 4.75
4.8 | 4 ratings

Contact us at files@mathworks.com