How can I add a title using slice plots?
Afficher commentaires plus anciens
Hey folks,
this is my first question in a forum ever XD (confetti)
I have a volume of measured data and found "slice" beeing perfect to plot those, but I dont know how to add a title and axes labels afterwards.
[Y,X,Z] = meshgrid(Ycm, Xcm, Zcm);
xslice = [Xcm(1),Xcm(2),Xcm(3),Xcm(4),Xcm(5),Xcm(6),Xcm(7)]; yslice = []; zslice = []; %no slices in y or z planes
sliceplot = slice(Y,X,Z, umat, yslice,xslice,zslice);
title='test'; -> gives me nothing
sliceplot.Title='test'; -> gives me "Expected one output from a curly brace or dot indexing expression, but there were 7 results."
sliceplot(1,1).Title='test'; -> gives me "Unrecognized property 'Title' for class 'matlab.graphics.primitive.Surface'."
(I know that I can add a title manually, but there is a lot of data to be plot, so an automatic command seems useful to me)
How can I access the plot features?
~~~~~~~~~~~~~~~
found it, title('test'); works, but still, is there a way to access the plot afterwards?
3 commentaires
KALYAN ACHARJYA
le 25 Avr 2019
If I undestand your question, are you looking for title, just keep title after slice plot
title('Title 1')
For axes
axis([%..label values..]);
xlabel('x axis label')
ylabel('y axis label ')
zlabel('z axis label')
For individual axis limit, use xlim, ylim check here
Or you are looking for title on individual slices?
Adam
le 25 Avr 2019
The title is a property of the axes, not the slice graphics object so you wouldn't expect:
sliceplot.Title='test';
or
sliceplot(1,1).Title='test';
to work. And
title='test';
just assigns the chars 'test' to a variable named title.
Code has to follow rules, we can't just type things that look intuitive and assume it will magically work as code!
doc title
will give information on adding titles.
Adam
le 26 Avr 2019
Properties of the slice graphics object itself are available on
slicePlot
If you want axes properties then you can get these from the axes handle, which is usually best to acquire right at the start of the process. I don't like using gca, but in the following case I find it acceptable if I am just writing a script:
figure; hAxes = gca;
Then I can use hAxes as my fixed graphics handle from there onwards.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Annotations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!