Effacer les filtres
Effacer les filtres

Why funny straight lines contour plots? especially when saving..

2 vues (au cours des 30 derniers jours)
Michael
Michael le 15 Mai 2016
Commenté : Tejas le 18 Mai 2016
I get strange lines when trying to save a plot with contour lines (see attached pic). How do I get rid of these straight lines? there are also some before saving depending on my set xlim or contour levels. I have a feeling there might be a setting I can turn on/off to remove this but not sure what it is...
code:
% all matrices are 500x93;
% Create axes
axes('Parent',gcf,...
'Position',[0.130555555555556 0.0685483870967742 0.791666666666667 0.157258064516129]);
contourf(xi_S(1:500,1:93).*Mask_bin_S(1:500,1:93),yi_S(1:500,1:93).*Mask_bin_S(1:500,1:93),...
zi_S(1:500,1:93).*Mask_bin_S(1:500,1:93),...
15,'LineStyle','none','Clipping','on')
hold on
contour(xi_S(1:500,1:93).*Mask_bin_S,yi_S(1:500,1:93).*Mask_bin_S,zi_S(1:500,1:93).*Mask_bin_S,...
37.8:0.2:38.6,'k','ShowText','On','Clipping','on')
% set contours to be certain intervals, not same as contourf
colormap(gca,flipud(cbrewer('div', 'RdYlBu', 100))); % colormap set
colorbar('peer',gca,'Position',...
[0.9320074833252 0.0698924731182796 0.0193814055636889 0.387096774193549]);
set(gca,'ydir','reverse','FontSize',16,...
'XTickLabel',['';'';'';'';'';'';'';'';'';'';'';'';'';''],...
'XTick',[735761 735762 735763 735764 735765 735766 735767 735768 735769 735770 735771 735772 735773 735774]);
% xlabel('time [days]');
ylabel('axis');
ylim([100 1000])
caxis([37.8 38.7])
xlim([7.357619044019791e+05 7.3577325e+05]);
fname = 'saving/location/'
set(gcf,'PaperUnits','centimeters','PaperPosition',[0 0 30 20])
print('-dpng', 'text.png, -r300');
saveas(gcf,fullfile(fname,['nameoffile']), 'png') %Save figure
  1 commentaire
Tejas
Tejas le 18 Mai 2016
Hello Michael, The following information might be helpful in understand your environment:
What release of MATLAB are you using?
What Operating System are you using?
What is the output of the "opengl info" command?
Do you see the issue with the "saveas" command or the "print" command or with both the commands?

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