This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
it_matlab_figures [2025/04/04 11:15] trinh |
it_matlab_figures [2025/05/02 18:40] (current) trinh |
||
---|---|---|---|
Line 3: | Line 3: | ||
Here are some brief details and tips for developing a good workflow for generating publication-quality images. | Here are some brief details and tips for developing a good workflow for generating publication-quality images. | ||
- | ===== A workflow for saving images ===== | + | ===== 1. A workflow for saving images ===== |
As you become a more experienced researcher, you will learn the value of developing a workflow where images can be easily re-generated. This means that you can easily replot the images when you are finalising the presentation. | As you become a more experienced researcher, you will learn the value of developing a workflow where images can be easily re-generated. This means that you can easily replot the images when you are finalising the presentation. | ||
Line 11: | Line 11: | ||
- **Tip: save your figures as .fig.** Similar to above, you may want to save '' | - **Tip: save your figures as .fig.** Similar to above, you may want to save '' | ||
- | ===== Exporting figures ===== | + | ===== 2. Exporting figures ===== |
Traditionally (meaning literally in the last 20 years), Matlab has had very poor ability to generate publication-quality images. Problems include: poor bounding boxes, weird rasterisation effects, weird layering issues, etc. | Traditionally (meaning literally in the last 20 years), Matlab has had very poor ability to generate publication-quality images. Problems include: poor bounding boxes, weird rasterisation effects, weird layering issues, etc. | ||
Line 29: | Line 29: | ||
in order to produce a PDF of the currently focused figure. | in order to produce a PDF of the currently focused figure. | ||
- | ===== Annotations ===== | + | ===== 3. Annotations ===== |
In order to add annotations to figures, you have a few options: | In order to add annotations to figures, you have a few options: | ||
Line 38: | Line 38: | ||
- | ===== Advanced image generation using TikZ ===== | + | ===== 4. Advanced image generation using TikZ ===== |
More ' | More ' | ||
- | There are nowvery | + | There are now very powerful scripts that allow Matlab figures to be automatically converted to TiKZ, such as [[https:// |
<code matlab> | <code matlab> | ||
Line 52: | Line 52: | ||
If you are an undergrad student or under pressure to write a report, I don't recommend trying to learn this! | If you are an undergrad student or under pressure to write a report, I don't recommend trying to learn this! | ||
+ | ===== 5. Colormaps ===== | ||
+ | |||
+ | The default colormaps are not so good. Use [[https:// | ||
+ | |||
+ | <code matlab> | ||
+ | set(0,' | ||
+ | </ | ||
+ | |||
+ | You can view all the colormaps with | ||
+ | |||
+ | <code matlab> | ||
+ | brewermap(' | ||
+ | </ | ||
+ | |||
+ | Open via `open brewermap` to view the documentation and examples. |