Effacer les filtres
Effacer les filtres

Drawing boundary lines in contour plot

6 vues (au cours des 30 derniers jours)
Alexander Engman
Alexander Engman le 19 Avr 2018

Hi!

I am creating a contour plot which I have attached. The data comes from a matrix named OPT that contains the values that I have plotted over the matrices Vfvec and rvec. The white areas of the plot come from the fact that OPT contains many NaN values, as it should.

What I would like to do is to make it more clear where the boundary of the contour plot is. Basically, I would like to draw a line connecting the ends of the contour lines on each side, so that it becomes very clear which part of the plot contains numerical values and which doesnt. I could also do this by just adding more lines to the plot, but then the contour labels rendered using clabel become messy. The do not appear as integers, and there are way too many of them.

So can someone explain either how can accomplish the first part (connecting the boundaries), or alternatively add more contour lines but controlling clabel properties to be integers and spaced manually?

Any other methods that you know for presenting the data in a proper way would be appreciated.

h=mesh(Vfvecq,rvecq,OPTq);
grid off
view(2)
set(h,'linestyle','none')
[C,h]=contour(Vfvecq, rvecq, OPTq,'Color','k','ShowText','on');
clabel(C,h,...
    'FontUnits','points',...
    'FontWeight','normal',...
    'FontSize',9,...
    'FontName','Times')
  2 commentaires
jonas
jonas le 19 Avr 2018
Alloy2 looks nice, whereas Alloy1 is too dense.
If you want to outline the edges of your data, then you could use something like boundary()
You could also shade the background where data is missing, use surf() to show all data, or combine surf and contour in a single plot. The best option depends on what you want to show with the figure
Alexander Engman
Alexander Engman le 19 Avr 2018
Boundary was what I was looking for. Thanks!

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Contour Plots dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by