mtex icon indicating copy to clipboard operation
mtex copied to clipboard

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

Open xgboosted opened this issue 8 years ago • 14 comments

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

xgboosted avatar Sep 01 '17 17:09 xgboosted

Have you tried

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

and

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

Ralf.

ralfHielscher avatar Sep 22 '17 10:09 ralfHielscher

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

xgboosted avatar Sep 22 '17 11:09 xgboosted

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

ralfHielscher avatar Sep 22 '17 12:09 ralfHielscher

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') 

xgboosted avatar Sep 22 '17 12:09 xgboosted

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).

xgboosted avatar Nov 27 '17 11:11 xgboosted

Please try

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

Ralf.

ralfHielscher avatar Nov 30 '17 19:11 ralfHielscher

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

xgboosted avatar Dec 01 '17 16:12 xgboosted

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.

ralfHielscher avatar Dec 01 '17 18:12 ralfHielscher

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

xgboosted avatar Dec 02 '17 13:12 xgboosted

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

bnmcbride avatar Dec 17 '20 17:12 bnmcbride

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

Ralf.

ralfHielscher avatar Dec 17 '20 19:12 ralfHielscher

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!

bnmcbride avatar Dec 17 '20 19:12 bnmcbride