- Resolution - By default, the resolution for figures is 150 dpi. You can try adjusting the resolution to your liking and check to see if the two plots(histogram, mesh) still look different. However, keep in mind that using a higher resolution value can yield higher-quality output but at the cost of higher memory use and larger output files. Furthermore, the higher the resolution setting, the longer it takes to render your figure.
- InvertHardCopy - This property changes the background color to white, changes white text objects and axes objects to black and changes black text objects and axes objects to white. This property is on by default, therefore, try turning this property off and see if makes any difference.
- Renderer - Graphics renderer, specified as '-opengl' or '-painters'. This is by default set to
What is the difference between a "histogram" and "mesh" when printing the figure to pdf
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Christian Wittpahl
el 18 de Mayo de 2017
Comentada: Christian Wittpahl
el 26 de Mayo de 2017
I've been trying to make plots of some data for a text I'm writing with TeX. I'm using this piece of code for changing and printing the plots:
set(0,'defaulttextinterpreter','latex');
set(0,'DefaultTextFontname', 'CMU Serif')
set(0,'DefaultAxesFontName', 'CMU Serif')
set(gcf,'PaperPositionMode','auto');
set(gcf,'PaperOrientation','landscape');
% I've tried this before, doesn't change the outcome
% set(gca,'FontName','CMU Sans Serif');
print('-dpdf','-bestfit','filename.pdf');
This works perfectly for some mesh plots im using:
mesh(data);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/164203/image.png)
but for a histogram:
histogram(different_data,'EdgeColor','none','BinWidth',1,'Normalization','probability');
I get a nice figure:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/164204/image.png)
but a bad pdf file:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/164205/image.png)
Does anyone know a way I can fix this within matlab?
0 comentarios
Respuesta aceptada
Abhinav Gurram
el 22 de Mayo de 2017
There can be quite a few reasons to why the histogram doesn't print as well as the mesh, to a pdf. A couple of things you can look at would be:
There are a lot of other properties you can configure for the 'print' command and as figure options, to enhance the quality of your image. You can find a list of these properties here:
Hope this helps!
Más respuestas (0)
Ver también
Categorías
Más información sobre Histograms en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!