tikz绘图学习(长期更新)
生活随笔
收集整理的這篇文章主要介紹了
tikz绘图学习(长期更新)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
tikz基于latex
tikz生成的圖片只能是嵌入在pdf中的,要想轉換成其他格式還需要額外的處理,例如使用imagegick.
tikz right of的用法
見上圖,使用right of可以精確的控制legend的位置。上圖就是精確的將legend控制在了點(-1, 2)右側.
inkscape應該無法直接導出tikz code
只能通過第三方開源的插件或軟件svg2tikz實現導出tikz code
冒號代表極坐標,上面的意思是坐標(1,140度)處
node在tikz中是一個很重要的思想,公切線和圓的圖片、流程圖都可以用node實現
\foreach
\foreach \x/\y in {0/0,0/1}這樣可以實現多個參數的傳遞
我想實現的:
1.節點距離自由控制;
2.字體自由控制
\itshape的意思就是意大利斜體。
坐標重置
我觀看的教學視頻
問題:畫折線找坐標時可以坐標重置,那么畫流程圖可不可以呢?
記得導入該導入的
\documentclass[a4paper,10pt]{article}\usepackage{tikz} \usetikzlibrary{shapes,arrows} \usetikzlibrary{shapes.geometric, arrows} \usetikzlibrary{positioning}\tikzstyle{input} = [rectangle,minimum width=2.75cm,minimum height=1cm,text centered,text width =3cm,draw=black,ultra thick] \tikzstyle{encoder_convolution_block} = [rectangle,minimum width=3cm,minimum height=0.78cm,text centered,text width =3cm,draw=black,fill=green!32] \tikzstyle{encoder_fc_block} = [rectangle,minimum width=3cm,minimum height=0.78cm,text centered,text width =3cm,draw=black,fill=green!64!yellow] \tikzstyle{decoder_convolution_block} = [rectangle,minimum width=3cm,minimum height=1cm,text centered,text width =3cm,draw=black,fill=blue!35] \tikzstyle{discriminator_convolution_block} = [rectangle,minimum width=3cm,minimum height=1cm,text centered,text width =3cm,draw=black,fill=red!35]\begin{document}\begin{tikzpicture}[node distance=2cm]\node[input] (input) {Input};\node[encoder_convolution_block, below=of input] (ec1) {3×3,conv,32,/2};\node[encoder_convolution_block,below=of ec1] (ec2) {3×3,conv,64,/2};\node[encoder_convolution_block,below=of ec2] (ec3) {3×3,conv,128,/2};\node[encoder_convolution_block,below=of ec3] (eflat) {Flatten};\node[encoder_fc_block,below=of eflat] (efc) {fc,16};\node[encoder_fc_block, left=100pt of efc] (mean) {$\mu_{z}$,16};\node[encoder_fc_block,below right= of efc] (std) {$\sigma_{z}$,16};% \node (process1) [process,below of=input1] {Process 1}; % \node (decision1) [decision,below of=process1,yshift=-0.5cm] {Decession 1}; % \node (process2a) [process,below of=decision1,yshift=-0.5cm] {Process 2aaaaaa aaaaaaa aaaa}; % \node (process2b) [process,right of =decision1,xshift=2cm] {Process 2b}; % \node (out1) [io,below of=process2a] {Output}; % \node (stop) [startstop,below of=out1] {Stop};% \draw [arrow] (start) -- (input1); % \draw [arrow] (input1) -- (process1); % \draw [arrow] (process1) -- (decision1); % \draw [arrow] (decision1) -- node[anchor=east] {yes} (process2a); % \draw [arrow] (decision1) -- node[anchor=south] {no} (process2b); % \draw [arrow] (process2b) |- (process1); % \draw [arrow] (process2a) -- (out1); % \draw [arrow] (out1) -- (stop);\end{tikzpicture}\end{document}上面代碼第六行,如果把這一行刪掉,即不導入positioning包,那么會報8個錯:Package PGF Math Error: Unknown function `of’ (in ‘of input’).
在不導入positioning包的情況下,數值設置below=10pt功能也不能使用。
見上圖,當below right=0cm時,efc的右下角和std的左上角重合。我猜這個0cm的位置參數就是指這兩個點的相對距離了。方向應該是正負45度線。
總結
以上是生活随笔為你收集整理的tikz绘图学习(长期更新)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【算法题】买帽子
- 下一篇: 自动驾驶系类文档(二)-- 定位模块(L