why does it has to be tedious to produce high quality figures for (academic) publications using MATLAB? (open Discussion)

14 visualizaciones (últimos 30 días)
If you use Matlab for data treatment, at some point you plot figures and you want to use them in reports, talks, papers, thesis...
Why does it has to be tedious to produce high quality figures?
I'll give you three examples to proof my point. Even if some of my examples are obsolet by now, or become obsolet later, there are plenty more. Please leave a comment on what should be implemented asap to improve the overall Matlab Figure experience. Leave a comment if you had a related problem with a link to an existing Forum entry to discuss solutions there. I'd like to push this topic to Mathworks.
Disclaimer:
Of course there are more powerful plotting alternatives to Matlab, I dont want to discuss this. By now, Matlab is usually good enough to get the work done. Yet, in many cases you have to rely on "dodgy" workarounds (practical speacking: community solutions of peaple kind enough to share their troubles) which tend to cause subsequent problems, or there may be no solution at all!
Example 1) exporting Figures:
Usually, with Matlab (e.g. savefig(), print(), or exportgraphics()) you get something else as what you see in the figure even if the aimed file formate theroretically supports the crucible options. This is very unintuitive! Therefore, Community solutions (export_fig, matlab2tikz/matlab2tikz...) have been trending for a decade (!) and are still my way to go!
Take Mathworks latest Solution "exportgraphics" (available since R2020a and decent in my opinion): you cannot control to what extend the white space is cut. Thus, the final Figure has random dimensions. I also have problems that fontSizes end up being 11.987... rather than 12-which is minor but still pain.
Example 2) customizing legends: should be a basic and intuitive thing:
Example 3) breaking axis
occcasionally, you may want to break one or more axis due to your data distribution. Breaking the axis with a visual highlight may be used for this (https://ch.mathworks.com/matlabcentral/answers/42537-break-in-the-axis). Yet, Matlab has not a native solution for this. Instead you have to write your own solution or rely on community code (breakaxis, break plot...).

Respuestas (1)

Jan
Jan el 17 de Nov. de 2022
Editada: Jan el 17 de Nov. de 2022
My trivial answer: This is the nature of "high quality figures". Depending on the journal you are publishing in different properties must by considered. There cannot be a general tool to match all of them on one hand and to produce fast graphic output on the other hand.
  3 comentarios
Jan
Jan el 18 de Nov. de 2022
I support a large program for clinical decition making. It is essential, that it runs over decades and therefore the lab used Matlab R6.5 for many years, proceeded to R2009a and now to 2018b. Introducing a new Matlab version takes about 2 months of testing, if the results are really equivalent. Beside unit- and integration tests for the > 300'000 lines of code (plus comments), we need exhaustive tests of the GUIs by users.
The legend() function has been subject to changes frequently and to get reliable outputs adjustments have been required for each Matlab version. Therefore we use our own code to create legends. This is disappointing.
While the change from HG1 to HG2 was not a serious problem, there are still some strange effects in both versions: With the OpenGL renderer the box around axes is not drawn reliably, but it helps to rotate the axes by 0.00001 degrees. The artifacts in PDF are legendary and using export_fig was a fundamental solution.
I do agree: There is a high potential for improvements.
On the other hand: I've written about 15 small wrapper functions to handle the incompatibilities between R6.5, R2009a and R2018b. The long term compatibility of Matlab code is really excellent, and the bad examples of legend and the graphic output are rare exceptions.
Thanks for your question. I agree in general, that the graphics export is tedious. If I had implemented the mentioned tool in C, an export of graphics would be something near to pure hell.
Karl_469
Karl_469 el 21 de Nov. de 2022
Editada: Karl_469 el 23 de Nov. de 2022
Thanks for sharing your experience, @Jan. If someone like you (thanks btw for all your essential answers in this forum! Countless times I've moved forward based on your input.) can agree on the "tedious" part, it speaks for itself. (and yeap, I am happy to have seemingly avoided pure hell by chance)
As a newbie, after spending way more hours than expected to get a nice figure, the last thing I was rdy for was to invest even more just for the export.
One just assumes, that after all these years of MATLAB, such a basic feature works like a charm. Maybe other people will join my complaints here, to make it visible.

Iniciar sesión para comentar.

Categorías

Más información sobre Graphics Object Programming en Help Center y File Exchange.

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by