Drawing boundary lines in contour plot

21 visualizaciones (últimos 30 días)
Alexander Engman
Alexander Engman el 19 de Abr. de 2018
Comentada: Alexander Engman el 19 de Abr. de 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 comentarios
jonas
jonas el 19 de Abr. de 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 el 19 de Abr. de 2018
Boundary was what I was looking for. Thanks!

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Contour Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by