MATLAB中的xkcd样式图 - xkcd style graphs in MATLAB

10/14 06:06
阅读数 0

问题:

xkcd风格的图形

So talented people have figured out how to make xkcd style graphs in Mathematica , in LaTeX , in Python and in R already. 因此,有才能的人已经想出了如何在MathematicaLaTeXPythonR中制作xkcd样式图。

How can one use MATLAB to produce a plot that looks like the one above? 如何使用MATLAB生成如上图所示的图?

What I have tried 我试过了什么

I created wiggly lines, but I couldn't get wiggly axes. 我创造了摇摆的线条,但我无法得到摇摆的轴。 The only solution I thought of was to overwrite them with wiggly lines, but I want to be able to change the actual axes. 我想到的唯一解决方案是用摇摆的线覆盖它们,但我希望能够改变实际的轴。 I also could not get the Humor font to work, the code bit used was: 我也无法使幽默字体工作,使用的代码位是:

 annotation('textbox',[left+left/8 top+0.65*top 0.05525 0.065],...
'String',{'EMBARRASSMENT'},...
'FontSize',24,...
'FontName','Humor',...
'FitBoxToText','off',...
'LineStyle','none');

For the wiggly line, I experimented with adding a small random noise and smoothing: 对于摇摆不定的线,我尝试添加一个小的随机噪声和平滑:

 smooth(0.05*randn(size(x)),10)

But I couldn't make the white background the appears around them when they intersect... 但是当它们交叉时,我无法使白色背景出现在它们周围......


解决方案:

参考一: https://en.stackoom.com/question/rIKP
参考二: https://stackoom.com/question/rIKP
展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部