How to make beautiful math graphics using Tikz & LaTeX

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ก.ค. 2024
  • Get started with LaTeX using Overleaf: ► www.overleaf.com/?.... My thanks to Overleaf for sponsoring today's video.
    Check out the previous videos in my LaTeX playlist:
    ► • LaTeX Tutorials
    Check out my MATH MERCH line in collaboration with Beautiful Equations
    ►www.beautifulequation.com/pag...
    In this video we're going to talk about making diagrams and other graphics using the tikz package in LaTeX. This package makes it really easy to create all the normal geometric shapes like lines and circles, but more importantly to precisely control the look and placement of these graphics. The use of "nodes" makes it particularly easy to make complicated diagrams where one uses relative instead of absolute placements.
    You can also check out the actual document I use in this video here: ►www.overleaf.com/read/zzbhmgt...
    0:00 Intro to Tikz
    0:28 LaTeX Editors and Overleaf
    1:16 What to put in the preamble
    2:40 Drawing Lines, Circles, Ellipses
    6:02 Drawing Rectangles and Grids
    8:00 Centering and Scaling
    9:25 Color, Dashed, Fill, Shading
    11:52 Arrows and Thickness
    12:50 Text and Nodes
    15:35 Node Example Diagram
    21:38 More Complicated Example
    COURSE PLAYLISTS:
    ►DISCRETE MATH: • Discrete Math (Full Co...
    ►LINEAR ALGEBRA: • Linear Algebra (Full C...
    ►CALCULUS I: • Calculus I (Limits, De...
    ► CALCULUS II: • Calculus II (Integrati...
    ►MULTIVARIABLE CALCULUS (Calc III): • Calculus III: Multivar...
    ►VECTOR CALCULUS (Calc IV) • Calculus IV: Vector Ca...
    ►DIFFERENTIAL EQUATIONS: • Ordinary Differential ...
    ►LAPLACE TRANSFORM: • Laplace Transforms and...
    ►GAME THEORY: • Game Theory
    OTHER PLAYLISTS:
    ► Learning Math Series
    • 5 Tips To Make Math Pr...
    ►Cool Math Series:
    • Cool Math Series
    BECOME A MEMBER:
    ►Join: / @drtrefor
    SOCIALS:
    ►Twitter (math based): / treforbazett
    ►Instagram (photography based): / treforphotography

ความคิดเห็น • 104

  • @isaackay5887
    @isaackay5887 2 ปีที่แล้ว +68

    Ever since I learned how to use LaTeX, I've haven't touched MS Word - nothing can make me go back

    • @hegelscat9423
      @hegelscat9423 2 ปีที่แล้ว +5

      Had a classmate who would refuse to use Latex, instead used word, no amount of convincing could get her to ditch word.

    • @nikosnikolakis6991
      @nikosnikolakis6991 ปีที่แล้ว +6

      word is far more easy to use to get something out

    • @TranquilSeaOfMath
      @TranquilSeaOfMath ปีที่แล้ว +3

      I like LaTeX better than MS Word

    • @dafphtthedislikeupdater7836
      @dafphtthedislikeupdater7836 ปีที่แล้ว

      ikr

    • @T12J7
      @T12J7 4 หลายเดือนก่อน

      I like Word due to the collapsible headers feature.

  • @zealous919
    @zealous919 2 ปีที่แล้ว +128

    I know you get a lot of these comments, I’m not trying to be annoying. But if you have the time and patience, please keep uploading (I understand if you can’t). You’re one of my favorite channels on this entire site. I love being able to sit back after a long day (basically everyday) and just watch math videos, especially from you since you’re a great presenter. Thanks

    • @DrTrefor
      @DrTrefor  2 ปีที่แล้ว +32

      That is so nice of you!

  • @johnchessant3012
    @johnchessant3012 2 ปีที่แล้ว +55

    For the longest time I thought TikZ was too complicated and resorted to making my graphs in Geogebra and attaching them to the latex file as pictures. Finally buckled down to learn it to draw binary trees for a cs class I was taking and later I also learned TikZ-cd to draw commutative diagrams for my number theory course. Definitely a cool package!

    • @diribigal
      @diribigal 2 ปีที่แล้ว +12

      The right Desktop version of Geogebra can export to TikZ code, so if you like Geogebra, you can still produce TikZ

    • @JimSmithInChiapas
      @JimSmithInChiapas 2 ปีที่แล้ว +7

      @@diribigal Thanks for the info -- I didn't know that. I still use GeoGebra Classic 5, and I now see that it can indeed export drawings as TikZ code. (Under *File* --> *Export* .)

  • @AdobadoFantastico
    @AdobadoFantastico 2 ปีที่แล้ว +3

    This is so cool. I'm only exploring math again recently and wanted to find a way to use the latex learning to do something more.

  • @ZackRekeSkjell
    @ZackRekeSkjell 2 ปีที่แล้ว +3

    As previously, great and informative video! I have learned a lot from them and I am looking forwards to the next one.

  • @kuijaye
    @kuijaye 2 ปีที่แล้ว +1

    you explain complex and arcane commands extremely well!
    Thanks man!

  • @FranzBinder20
    @FranzBinder20 ปีที่แล้ว

    The Node Example Diagram is more or less exactly what I needed. Thanks!

  • @hengky753
    @hengky753 2 ปีที่แล้ว +1

    Nice and clear. I hope for more videos about drawing and plot from this channel.

  • @gudaguda5299
    @gudaguda5299 11 หลายเดือนก่อน +1

    Very good tutorial for tikz! It also helped me learn LaTeX better!

  • @LordChancletus
    @LordChancletus 2 ปีที่แล้ว +6

    I'm so hyped for this series! Looking forward in learning Tikz and pgfplots in such a chill and well explained manner. Can you maybe throw in some circuitikz later on? 👀

    • @DrTrefor
      @DrTrefor  2 ปีที่แล้ว +2

      Not a bad idea!

  • @patheba4394
    @patheba4394 2 ปีที่แล้ว +1

    I was really waiting for this video

  • @lumbradaconsulting6825
    @lumbradaconsulting6825 2 ปีที่แล้ว +1

    Very cool, thank you

  • @jirodelPenderisco
    @jirodelPenderisco 2 ปีที่แล้ว +1

    Excelente. Muchas gracias.

  • @michaelrudert3406
    @michaelrudert3406 2 ปีที่แล้ว +2

    Hi Dr. Bazett, let me use this opportunity to thank you for all those really interesting and really good explained videos over all the fields of applications of mathematics and the useful software for visualizing it. There was no single video that bored me. 👍

    • @DrTrefor
      @DrTrefor  2 ปีที่แล้ว +1

      Glad to hear that!!

  • @wjrasmussen666
    @wjrasmussen666 2 ปีที่แล้ว +1

    I was worried that you were done making these videos. Thanks for the LaTeX videos.

  • @Nalisification
    @Nalisification 2 ปีที่แล้ว +2

    I love latex! I write everything in is using orgmode. It's amazing

  • @josefernandezvargas9189
    @josefernandezvargas9189 8 หลายเดือนก่อน +1

    Bro this channel is \textbf{UNDERRATED}

  • @muhammadadil3981
    @muhammadadil3981 2 ปีที่แล้ว +1

    great sir ....
    Sir, can you show us how to draw subfigures in latex, like 1x2, or 2x2

  • @Ting3624
    @Ting3624 2 ปีที่แล้ว +5

    The documentation of Tikz is actually a pretty good read, albeit a very long doc, especially the tutorial part, it has a lot of ... let's say ... Germanic humor :)

  • @econhelp583
    @econhelp583 2 ปีที่แล้ว +10

    I was just thinking that I wanted to watch a few ( or many!) videos on LaTeX. LaTeX has been around a long time and I have known about it and dabbled with it for well over a decade. I think that historically, the main reason that LaTeX has not gone viral is due to software installation and maintenance headaches. I discovered Overleaf last year and it makes using LaTeX much much easier. I am hoping that products like Overleaf encourage instructors to bring LaTeX into the math curriculum in a formal way and to actively encourage the use of LaTeX. I am very glad to have subscribed to Dr. Bazett’s TH-cam channel. Well done and thanks for the videos. I am looking forward to more videos on LaTeX!

    • @philperry6564
      @philperry6564 2 ปีที่แล้ว

      The main reason that LaTeX has not gone viral is, is because it's not as easy to use as Word or Pages. You have almost complete control over the outcome, at the cost of usability. Same with Linux. I do agree, that maintaining a source document that has a lot going on, is very difficult and time consuming.

  • @ciocio5740
    @ciocio5740 6 หลายเดือนก่อน

    Amazing t-shirt!

  • @abiuniverse
    @abiuniverse ปีที่แล้ว +1

    How to adjust the distance between boxed nodes (instead of using below=of etc)?

  • @jadepangwaiho
    @jadepangwaiho 2 ปีที่แล้ว +6

    I love your videos! May I ask is there any way to draw the graphs from graph theory by tikz?

    • @DrTrefor
      @DrTrefor  2 ปีที่แล้ว +3

      Absolutely! The node based approach in the later examples works great for graph theory stuff

    • @haraldurkarlsson1147
      @haraldurkarlsson1147 2 ปีที่แล้ว

      There is probably a library for that in either tizk or pgf or possibly a special latex package.

  • @AlexLiberzon
    @AlexLiberzon 2 ปีที่แล้ว

    Could you please record a video about how do you shoot these beautiful videos with the screen recording on your background.

  • @greisthomson
    @greisthomson 2 ปีที่แล้ว +1

    I'm having project in my last SEM. This might have been more useful if it was uploaded atleast a few days back. Anyway, Thank you for the Latex tutorials.

  • @eguineldo
    @eguineldo 3 หลายเดือนก่อน

    That with arrows is going to be very nice

  • @amirkhan355
    @amirkhan355 11 หลายเดือนก่อน

    Thank you so much. Where is the link to the latex doc BTW?

  • @fahadkhan5260
    @fahadkhan5260 2 ปีที่แล้ว +1

    I should we learn math in this way. ❤️

  • @alexmadsen9394
    @alexmadsen9394 5 หลายเดือนก่อน +1

    Please do a tutorial to circuitikz !!!🙏

  • @madhavsirohi2225
    @madhavsirohi2225 ปีที่แล้ว

    13:56 This is even better than adobe tools!!!

  • @haraldurkarlsson1147
    @haraldurkarlsson1147 2 ปีที่แล้ว +1

    Dr. Trefor,
    I am looking forward to your next "tiks" presentation. I am particularly interested in graphing functions. The one thing I have struggled with is plotting a circle with pgf. It will only give me a half circle. I want to use the actual function rather than using a "cheat" like solving it first, finding the center and radius and then just plotting with tikz's \draw circle.
    By the way the scaling function you mentioned early on will work fine in standalone document class but if you have it inserted in text then the transformation will not make space in the text for that image. It will overlap the text.
    I have watched a bunch of videos (there are not many on tikz) and I am always surprised by the depth and flexibility of the software - no wonder, the user's manual is 1000 pages plus.
    Thanks!

    • @DrTrefor
      @DrTrefor  2 ปีที่แล้ว +3

      The problem is that a circle isn't the graph of a function so unless you do something like convert to polar coordinates, you can't plot the full circle using function plotting.

    • @haraldurkarlsson1147
      @haraldurkarlsson1147 2 ปีที่แล้ว

      @@DrTrefor
      Thanks for the reply. As far as I can tell it also runs into a problem with negative square roots so it breaks. Perhaps someone will come up with a solution that involves plotting one half (the positive part) and then simply mirror it.

  • @jagula
    @jagula 2 ปีที่แล้ว +1

    Can you put something next to curved arrows (ones you used contols on)?

    • @DrTrefor
      @DrTrefor  2 ปีที่แล้ว +1

      Think I would just use a new mode to “manually” place the text, although there likely is a cleaner way I’m just not aware of yet

  • @syedshahfahd2659
    @syedshahfahd2659 ปีที่แล้ว

    I want to use alphanumeric characters in the x-axis for a graph, but whenever I try to punch the alphanumeric characters in the x-axis coordinate, it shows errors. Can you help in this regard?

  • @peterstucklschwaiger2830
    @peterstucklschwaiger2830 2 ปีที่แล้ว +1

    Love the tutorial (like the others)!
    I really should give TikZ a try the next time I have to draw graphs … that seems so much prettier than anything doable with (online) PowerPoint (not to mention the hassle with the arrow connection points … and that even online PowerPoint is a PIT* on LInux systems). And maybe ditch the KoMa document classes for further projects (sometimes them are too much of a paronomasia ;-)).
    Yet … I am puzzled you're typing “LaTeX” instead of commanding “\LaTeX” :-/

  • @SriHariBH
    @SriHariBH 2 ปีที่แล้ว

    Small request - please make a video on how you create your videos. :)

  • @lordstevenson9619
    @lordstevenson9619 2 ปีที่แล้ว +1

    Can’t wait for more tutorials, very well explained. I’ve got a long way still, but I would love to write my dissertation using LateX. I’ve dabbled with it but need more exposure with the code.

    • @DrTrefor
      @DrTrefor  2 ปีที่แล้ว +5

      You should totally do your thesis in LaTeX, it is great for that.

    • @lordstevenson9619
      @lordstevenson9619 2 ปีที่แล้ว +1

      @@DrTrefor I’ve pretty much finished my first year, I got 3 more left including an industry placement year, so I got plenty of time to practise and think about ideas.
      I’m doing a BSc Mathematics & Computer Science degree and I’m loving it. Your channel and many in the TH-cam math community keep me motivated. Much love. ❤️

    • @robwin0072
      @robwin0072 2 ปีที่แล้ว +2

      Practice Practice Practice
      I began at NASA in the mid-eighties when it was TeX.
      When I say, LaTeX is to TeX, as Browsers was for Arpanet (Predecessor to the Internet).
      Without LaTeX, the method would remain in obscurity.
      Now, LaTeX provides the avenue for mass adoption. I hope so.
      I think it should begin with middle school and get progressively expansive year after year.

  • @Andrumen01
    @Andrumen01 ปีที่แล้ว +1

    LaTeX has really evolved ever since I started using it back in 2002! Amazing!
    Do you know where these packages are being developed? Like, the actual programming code rather than the markdown?
    Thanks!

    • @DrTrefor
      @DrTrefor  ปีที่แล้ว +2

      Packages are all over the map, individuals or groups who are updating their specific packages like tikz or whatever. There is no central control.

    • @Andrumen01
      @Andrumen01 ปีที่แล้ว

      Thank you.

  • @ami6packs
    @ami6packs 11 หลายเดือนก่อน

    Any tips on using latex to make nice software architecture diagrams..

  • @SocratesAlexander
    @SocratesAlexander 2 ปีที่แล้ว +1

    Can we export a document to the InDesign software while keeping the formatting?

    • @DrTrefor
      @DrTrefor  2 ปีที่แล้ว +2

      I don’t believe LaTeX can do this, because the formulas etc all need latex, but certainly one can export the tikz image and put that into indesign

    • @SocratesAlexander
      @SocratesAlexander 2 ปีที่แล้ว

      @@DrTrefor I think we can export a "tikz" image as a "jpg" or a "png" image... Do we do this from inside overleaf, or from the compiled and saved "pdf" file? And we are still waiting for the new tutorial....

  • @jamesmorgan3539
    @jamesmorgan3539 2 ปีที่แล้ว +1

    The pronunciation of TikZ is debatable. The two competing pronunciations are "tik-zee" and "tics". You can hear both in this video! "tik-zee" @2:38 and "tics" @2:26. For me, "tics" is just short for "tik-zee."
    Tikz is a recursive acronym of the German phrase "TikZ ist kein Zeichenprogramm." Translated to English, "TikZ is not a drawing language."

  • @DouglasKubler
    @DouglasKubler ปีที่แล้ว

    Great learning by example series. You mentioned GeoGebra. Oh! I see below a comment that GeoGebra can export as Tikz. Have you found other products that will export Tikz?

  • @alecclews
    @alecclews 2 ปีที่แล้ว

    It looks like TikZ is easier to use than ImageMagick when drawing diagrams? I use Markdown instead of LaTeX (simple needs), but I'm always on the lookout for an easier way to create diagrams.

  • @picsi-software
    @picsi-software 2 ปีที่แล้ว +1

    Its not just for maths... :) I use it for all my consulting reports

  • @kingsgambit
    @kingsgambit 2 ปีที่แล้ว +4

    there is an error: in 10:10 you say that the point specified before arc is its center. It is its starting point for the arc line though.

  • @maxferreira1221
    @maxferreira1221 8 หลายเดือนก่อน

    What do you think about pstricks?

  • @chickengoatfish
    @chickengoatfish 11 หลายเดือนก่อน +1

  • @allenli6715
    @allenli6715 2 ปีที่แล้ว +1

    Could you make a video talking about how do you survive your PhD in uoft.

    • @DrTrefor
      @DrTrefor  2 ปีที่แล้ว +2

      I actually have this exact video planned! Maybe two months from now or thereabouts in the schedule:)

  • @davidecascioli4717
    @davidecascioli4717 2 ปีที่แล้ว +1

    when will the next video come out?

    • @DrTrefor
      @DrTrefor  2 ปีที่แล้ว +1

      Haha about one month:)

  • @Fanaro
    @Fanaro 5 หลายเดือนก่อน

    Do a video comparing TikZ to PSTricks

  • @robwin0072
    @robwin0072 2 ปีที่แล้ว +2

    Dr., after watching this video, I stumbled attempting to understand why to use Tikz for such efforts; when one can use drawing software, then \include the image in LaTeX *.tex file.
    Why would one not considered this Tikz effort a waste of time?

    • @Croesquared
      @Croesquared 2 ปีที่แล้ว +2

      If you already have experience using vector graphics software like Illustrator or Inkscape, then you may consider those. However, TikZ is nice because the image is integrated into your document. Therefore, if you would like your labels to be in the same font as your paper, TikZ is better.
      TikZ also has many extension packages that you can use to create varied graphics arguably easier than using external tools, like CircuitTikZ for circuit diagrams.

    • @DrTrefor
      @DrTrefor  2 ปีที่แล้ว +3

      To me, both have their uses. Tikz is good because you can mathematically control everything with coordinates and formulas etc, AND can display math formulas etc using latex all in your diagram with full control. But I still for sure make graphics in illustrator or whatever else as well, depending on need.

    • @robwin0072
      @robwin0072 2 ปีที่แล้ว

      @@DrTrefor I began at NASA in the mid-eighties when it was TeX.
      When I say, LaTeX is to TeX, as Browsers was for Arpanet (Predecessor to the Internet).
      Without LaTeX, the method would remain in obscurity. Now, LaTeX provides the avenue for mass adoption. I hope so.
      I think LaTeX be in the curriculum beginning with middle school and get progressively expansive year after year.

  • @mulanidhaval1524
    @mulanidhaval1524 7 หลายเดือนก่อน

    Please help me , I can't make arrow from bottom box to top box
    I got this type of error:-
    Use of \tikz@curveCdot doesn't match its definition....ntrols +(right:17mm) and + (right:17mm) (A..

  • @luisalejandrohernandezmaya254
    @luisalejandrohernandezmaya254 ปีที่แล้ว

    Good! but please use a dark background.

  • @Wutheheooooo
    @Wutheheooooo หลายเดือนก่อน

    Geogebra can make Tikz code which can be powerful.

  • @eetulehtonen69
    @eetulehtonen69 2 ปีที่แล้ว +1

    Latech?

    • @DrTrefor
      @DrTrefor  2 ปีที่แล้ว +1

      Haha people like saying it both ways

  • @haraldurkarlsson1147
    @haraldurkarlsson1147 ปีที่แล้ว

    TikZ is an excellent package but the learning curve is steep - a sheer cliff like the steep side of Half Dome in Yosemite National Park.

  • @TheBuilder
    @TheBuilder 6 หลายเดือนก่อน

    typing up my ascii notes in this rn to impress my friends lets gooo

  • @meguellatiyounes8659
    @meguellatiyounes8659 2 ปีที่แล้ว

    tikz animation in beamer

  • @Heisenberg2097
    @Heisenberg2097 2 ปีที่แล้ว +1

    The problem about LATEX is the same as about Maths. The learning curve is too high. Once you get into it. It is fluid. But if you just want to write some documents... the effort is too high. Another bad option is to use Office products... only hell smells better. Today u can write beautiful documents with plain HTML... add some SVG and it is print perfect. Resolution independent. No matter you write for a scientific publication or the next high-gloss magazine... it will come out perfect due to vector maths. And it will be device independent. The future keeps on moving. BTW. For HTML u don't need to install no CYGWIN or MinGW or Ubuntu... even ur phone no matter if Android or IOs can serve u good. And everybody knows... HTML will be there and readable the next five to seven thousand years. Whereas LATEX even today noone can read. At least noone with a reason-capable mind. It is like learning latin... it will not impress any girl. maybe some old hunches that had to go through that hell too. But no cute cookie. I was cool enough to impress a girl with solving the Maxwell equations. See. Solving the equations is one thing. But impressing a girl with that is MASTER CLASS!!!

  • @ant3978
    @ant3978 2 ปีที่แล้ว

    why does he call it latek not latex

    • @diribigal
      @diribigal 2 ปีที่แล้ว

      Basically, because TeX is an abbreviation for the Greek word that gave rise to the English word "technical". See en.wikipedia.org/wiki/TeX#Pronunciation_and_spelling

    • @wrcz
      @wrcz 3 หลายเดือนก่อน

      @@diribigalso it's the same pretentious bullshit like GIF's creator "intending" it to be pronounced as jiff. no thanks

  • @Philoreason
    @Philoreason 2 ปีที่แล้ว +3

    Basically, don't do it. LateX is NOT for drawing. You much better off drawing your diagram / charts using other tools, then import them as picture.

  • @yatsenkoanton
    @yatsenkoanton 2 ปีที่แล้ว +1

    How the hell did this appear in my youtube if all I watch are Vtubers talking about h*ntai and other indecent activities? I indeed have a degree but I chose the path of a degenerate and never watched a math related video on youtube for years
    Great content tho, I don't know why ppl still use WYSIWYG for their diplomas wtf

    • @DrTrefor
      @DrTrefor  2 ปีที่แล้ว +2

      The TH-cam algorithm knows all

  • @viktorbakacs2867
    @viktorbakacs2867 2 ปีที่แล้ว

    just use photoshop )

  • @bishalthapa2179
    @bishalthapa2179 2 ปีที่แล้ว +1

    good explanation, but was not helpful to me.

  • @thshm2938
    @thshm2938 2 ปีที่แล้ว

    But, would'nt this be wasting time????

    • @diribigal
      @diribigal 2 ปีที่แล้ว +1

      It depends what you're trying to do. Especially if you use the power of LaTeX to change the style of the document at once, but also if you want fine-grained control of the vector images while seamlessly including math expressions and avoiding switching back and forth with something like Illustrator, this might be right for you. Since I don't know illustrator and find it easier to make programmatic diagrams in TikZ than Geogebra or something, it's sometimes right for me

  • @larrytrahan8260
    @larrytrahan8260 2 ปีที่แล้ว +1

    diễn xàm quá