mtex icon indicating copy to clipboard operation
mtex copied to clipboard

plotting a circle - glitch

Open kilir opened this issue 6 years ago • 0 comments

Hi Ralf, I'm trying to plot cones with variable opening angles. Simple example - which does what I expect:

circle(xvector,25*degree)
hold on
circle(yvector,45*degree,'add2all')
hold off

ex1

However, when it's more complex, I did not find an easy way to have the line of the cone appear on both hemispheres except for drawing them separately.

% some data
cs=crystalSymmetry('1',[8.1, 13, 7.2],[94.23, 116.64, 87.72]*degree,'X||a*', 'Z||c' )
o = orientation('Euler',[322.049 87.7868 226.876; 50.0499 105.209 49.6594],cs) 

col= [ 0.2422    0.1504    0.6603;
         0.5044    0.7993    0.3480];     % just two colors  one for each o
cw =  [35 75];                                    % two conewidths, one for each o

%  some crystal directions I'd like to draw these cones around
hs ={Miller(0,0,1,'uvw',cs) Miller(0,1,0,'uvw',cs) Miller(0,1,0,'hkl',cs)}

for j=1:length(hs)
    for i=1:length(o)
            circle(o(i)*hs{j},cw(i)*degree,'lineColor',col(i,:),'linewidth',2,'upper')
            hold on
    end
     hold off
     mtexTitle(hs{j}.char)
     nextAxis
    for i=1:length(o)
            circle(o(i)*hs{j},cw(i)*degree,'lineColor',col(i,:),'linewidth',2,'lower')
            hold on
    end
     hold off
     mtexTitle(hs{j}.char)
     nextAxis       
end   

ex

Plotting both at once, didn't work for me i.e. 'add2all' painted the cones all over the place and neglecting 'add2all' just paints the lower hemisphere for the second orientation.

So, could there be any easier way, or maybe better, make plotPDF aware or 'circle'?

Cheers, Rüdiger

kilir avatar Mar 12 '18 11:03 kilir