mtex-toolbox / mtex

MTEX is a free Matlab toolbox for quantitative texture analysis. Homepage:
http://mtex-toolbox.github.io/
GNU General Public License v2.0
286 stars 185 forks source link

Moving the vector3d axis labels outside of the hemisphere boundary in Pole Figure #266

Open GolamRashed opened 7 years ago

GolamRashed commented 7 years ago

The labels are slightly covering the Pole Figure hemisphere boundary with the white background color, making them transparent renders the labels hard to read. It would be great to have the labels placed outside of the hemisphere boundary.

image

ralfHielscher commented 7 years ago

Have you tried

text(vector3d.X,'TD','horizontalAlignment','left')

and

text(vector3d.Y,'ND','VerticalAlignment','bottom')

Ralf.

GolamRashed commented 7 years ago

It worked but now I have duplicated labels, is there a way to suppress the pole figure annotation?

% set pole figure annotation
pfAnnotations = @(varargin) text([vector3d.X,vector3d.Y],{'TD','ND'},...
  'BackgroundColor','w','tag','axesLabels',varargin{:});
setMTEXpref('pfAnnotations',pfAnnotations);
% set font size
setMTEXpref('FontSize',22);

<<<ODF estimation and Pole figure calculation here>>>

figure
plotPDF(odf,h,'antipodal','projection','eangle','contourf','minmax')
CLim(gcm,'equal'); % set equal color range to all plots
mtexColorbar('location','southOutSide','title','M.U.D.')
% moving the vector3d axis labels outside of the hemisphere boundary
text(vector3d.X,'TD','horizontalAlignment','left')
text(vector3d.Y,'ND','VerticalAlignment','bottom')

prtscr capture_2

ralfHielscher commented 7 years ago

have a look here https://github.com/mtex-toolbox/mtex/blob/ed9abd9922c1d5ca85cdc9540829e3ecbbcde4b2/mtex_settings.m#L41

GolamRashed commented 7 years ago

I have used it -

% set pole figure annotation
pfAnnotations = @(varargin) text([vector3d.X,vector3d.Y],{'TD','ND'},...
  'BackgroundColor','w','tag','axesLabels',varargin{:});
% uncomment the following line to disable the annotations
pfAnnotations = @(varargin) do_nothing;
setMTEXpref('pfAnnotations',pfAnnotations);
% set font size
setMTEXpref('FontSize',22);

Result -

estimate optimal kernel halfwidth: 100%
Undefined function or variable 'do_nothing'.

Error in Steel_90_long>@(varargin)do_nothing

Error in ODF/plotPDF (line 54)
  pfAnnotations('parent',mtexFig.gca,'doNotDraw');

Error in Steel_90_long (line 195)
plotPDF(odf,h,'antipodal','projection','eangle','contourf','minmax') 
GolamRashed commented 6 years ago

Hi Ralf, I was wondering if this feature has been updated in MTEX (Moving the vector3d axis labels outside of the hemisphere boundary in Pole Figure).

ralfHielscher commented 6 years ago

Please try

pfAnnotations = @(varargin) [];
setMTEXpref('pfAnnotations',pfAnnotations);

Ralf.

GolamRashed commented 6 years ago

I did this -

% set pole figure annotation
pfAnnotations = @(varargin) text([vector3d.X,vector3d.Y],{'TD','ND'},...
  'BackgroundColor','w','tag','axesLabels',varargin{:});
% uncomment the following line to disable the annotations
pfAnnotations = @(varargin) [];
setMTEXpref('pfAnnotations',pfAnnotations);
plotPDF(odf,h);
% moving the vector3d axis labels outside of the hemisphere boundary
text(vector3d.X,'TD','horizontalAlignment','left')
text(vector3d.Y,'ND','VerticalAlignment','bottom')

Is there a way to move the Miller indices further to north?

prtscr capture

ralfHielscher commented 6 years ago

Have a look here https://groups.google.com/forum/#!topic/mtexmail/v5DyVKW9L6k how to get a handle to the title. the title has position and alignment properties which can be altered. Does this help you?

Ralf.

GolamRashed commented 6 years ago

I was able to get the handle on the title, but could not align it properly. So I went with transparent background and bright color for now. However, I will request to implement the "native" ability to move the vector3d axis labels outside of the hemisphere in the future version.

Now, I noticed something, the first plot has the title (100) a bit upper position than the rest of the plots. It is the same for MTEX 4.5.0 as well. I was wondering if it is some sort of bug?

prtscr capture_2

bnmcbride commented 3 years ago

Has this issue (trying to put RD, ND outside the hemisphere) been addressed in a new MTEX release?

ralfHielscher commented 3 years ago

The issue of suppressing the original annotation has been addressed. How to place RD and ND outside has already been described above.

Ralf.

bnmcbride commented 3 years ago

Ah, I had my setMTEXpref with x = north, and y = east so the Vertical/Horizontal alignments needed to be swapped for each respective vector3d..

Thanks!