Это видео недоступно.
Сожалеем об этом.

Creating Graphs in Troff/Groff with Grap

Поделиться
HTML-код
  • Опубликовано: 30 окт 2020
  • This is the 11th video in a series of videos taking you from a beginner to a pro at using Troff/Groff.
    This tutorial is focused on Grap a preprocessor for drawing graphs
    The example file shown in this video: gist.github.com/Gavinok/e06d1...
    Ted Faber's grap:
    www.lunabase.org/~faber/Vault...
    plan9port/PLAN 9 from USER SPACE:
    9fans.github.io/plan9port/
    Grap User Manual:
    doc.cat-v.org/unix/v8/grap.pdf
    Let me know what you think and if there is anything specific you would like to learn about.
    Github: www.github.com/gavinok
    vimrc: github.com/Gavinok/dotvim
    Resume: github.com/Gavinok/Groff-resume
    Discord: / discord

Комментарии • 41

  • @kevinnel7038
    @kevinnel7038 3 года назад +6

    Brian kernighan is my favorite old school computer scientist

  • @Flash136
    @Flash136 3 года назад +11

    It's simply amazing how much customizability you have with these graphs, and yet you're still just using Troff/Groff.

    • @GavinFreeborn
      @GavinFreeborn  3 года назад +5

      Grap is amazing and there is still more I wanted to cover. You can even use pic commands within grap for more customizability. If you are using the Ted Faber version you can also add colors.

    • @srs26
      @srs26 2 года назад

      @@GavinFreeborn I found that using grap I cannot use dotted lines, just solid or dashed... Any idea why??

  • @KD5NJR
    @KD5NJR 3 года назад +6

    Man ! I’ve been needing something like this.

  • @zazem4835
    @zazem4835 3 года назад +2

    You just safe me from fail my subject, love u a lot

  • @cranknlesdesires
    @cranknlesdesires 3 года назад +2

    Man this is great, great tool and great video.

  • @potatolord2858
    @potatolord2858 3 года назад +1

    a nice and underrated intro to grap

  • @pasdenom.9062
    @pasdenom.9062 3 года назад +1

    My new favorite youtube channel.

  • @ANDIS62
    @ANDIS62 3 года назад +2

    Good info!

  • @lordofenron
    @lordofenron 3 года назад

    Great video :) Thanks!!

  • @particularvgr6753
    @particularvgr6753 3 года назад +2

    Awesome

  • @ethana.838
    @ethana.838 3 года назад +6

    Very good video, I'm about ready to ditch markdown.
    I would be interested in checking out those
    .so /home/gavinok/*.tmac files
    At the moment, I don't think they are in any dot-file repositories.

    • @GavinFreeborn
      @GavinFreeborn  3 года назад +4

      I have not gotten a chance to clean it up so its a bit of a mess. Here is the current version of it .
      gist.github.com/Gavinok/0d0f05c6223f1538aec7439f047234dd

    • @ethana.838
      @ethana.838 3 года назад +1

      @@GavinFreeborn Thanks!

    • @lucapham-trong7718
      @lucapham-trong7718 3 года назад

      It took me 15 minutes to find a missing "$" sign from markdown debug. Stay away from this kid unless you need to write very advanced math

    • @GavinFreeborn
      @GavinFreeborn  3 года назад

      @@lucapham-trong7718 like you where missing a $ for using eqn?

  • @kevinnel7038
    @kevinnel7038 3 года назад +1

    Also, is there a way to specify lengths and widths using a relative unit like text width, in latex you can use something like 0.5\textwidth for example if you want something to be half the text width. In Geoff I'm not really sure what units it used by default.

    • @GavinFreeborn
      @GavinFreeborn  3 года назад +1

      Since groff allows for scaling of pic/grap pictures there isn't really a default unit as far as I know. when setting things like indent you can use `u` for a device unit and `i` for an inch `c` for centemeters. I hope that helps. here is an example of what I mean.
      ```
      .in 1i
      this is at a 1 inch indent
      ```
      feel free to join the discord and ask more questions there.

  • @jessechen9275
    @jessechen9275 3 года назад

    When i want to draw a line plot. I would like to know if it is possible to set the horizontal coordinates of the scientific notation. Is it possible to do this in grap when the data distribution is relatively large?

    • @GavinFreeborn
      @GavinFreeborn  3 года назад

      Sadly I don't know of a built in way to use scientific notation sorry.

  • @lucabaldassi6024
    @lucabaldassi6024 3 года назад +2

    Awesome! I've started taking notes in my statistics class with groff and at the first lesson i encountered a problem, how can i make pie charts in grap? I looked up a couple documentation pdf's but i couldn't find any way to do that.

    • @GavinFreeborn
      @GavinFreeborn  3 года назад +1

      Off the top of my head you would want to either use copy thru or define a macro in grap using pic inside of it. this would probably require you to do some trigonometry. Here is another option that you could use if you want to use groff's postscript driver. Feel free to join the discord I could probably help more there.
      ```
      .sp 3c
      .de YY
      ps: def
      /wedg
      { gsave currentpoint translate 1 -1 scale
      newpath 0 0 moveto 0 0 5 2 roll 3.6 mul exch
      3.6 mul dup 3 1 roll add arc closepath
      gsave fill grestore 0 setgray stroke
      grestore }
      def
      ..
      .ds wedg \m[\\$2]\Z'\N'32''\
      \X'ps: exec \
      [pieradius] \
      [pieangle] \\$1 wedg'\
      \R'pieangle +\\$1'\m[]
      \Y[YY]\c
      .eo
      .de pie
      This is a line with \D'l 5p 0'\h'
      [pieradius]p'\h'1p'\
      \*[wedg 10 red]\
      \*[wedg 20 green]\
      \*[wedg 30 blue]\
      \*[wedg 2 purple]\
      \*[wedg 38 yellow]\
      \h'1p'\h'
      [pieradius]p'\D'l 5p 0' in the middle of it.
      ..
      .ec
      .nr pieangle 0
      .nr pieradius 35
      .pie
      .nr pieradius 10
      .nr pieangle 20 \" 20% is 72 degrees
      .pie
      ```
      on the topic of stats notes this may interest you github.com/Gavinok/stat260

    • @lucabaldassi6024
      @lucabaldassi6024 3 года назад +1

      ​@@GavinFreeborn Thanks a lot!
      I took a look at your macro and i couldn't understand much, so I studied GRAP a bit and found a way to do it without PIC commands

    • @GavinFreeborn
      @GavinFreeborn  3 года назад +1

      @@lucabaldassi6024 that's great to hear! Any chance I could see an example? Just interested

    • @lucabaldassi6024
      @lucabaldassi6024 3 года назад +2

      @@GavinFreeborn
      .G1
      ticks off
      frame invis ht 2.5 wid 2.5
      coord x -1.25,1.25 y -1.25,1.25
      define slice X # (relative frequency, cumulative frequency, label)
      fr = $1
      fc = $2
      # Draw labels outside the circle in the middle of the slice
      class = fc - fr / 2
      classangle = class * 2 * pi
      classx = cos( classangle ) * 1.1
      classy = sin( classangle ) * 1.1
      if class

    • @GavinFreeborn
      @GavinFreeborn  3 года назад +1

      @@lucabaldassi6024 wow great job!

  • @ReggieRockification
    @ReggieRockification 3 года назад

    What about other kinds of graphics like gantt plots (which I've done using tbl before), heatmaps, or dendrograms?

    • @GavinFreeborn
      @GavinFreeborn  3 года назад +1

      I don't see any reason you wouldn't be able to make those types of graphs. Really grap is an additional front end for pic and pic is just a front end to Troff/Groff. Those would definitely take some work but it can be done. I have a video in pic that should help get you started. I'd use the Ted Faber version since it supports Groff's colors. Which all of these graphs appear to require.

  • @hectorcanizales5900
    @hectorcanizales5900 2 года назад

    Hey there! Do you have a tutorial on how to embed images ?
    edit: never mind, I just checked your g/t roff playlist and there's a vid 'bout it. thanks

    • @GavinFreeborn
      @GavinFreeborn  2 года назад +1

      for Groff? Why yes I do ruclips.net/video/m1WC0Ww_S2E/видео.html

  • @kevinnel7038
    @kevinnel7038 3 года назад +2

    Is there a way to preprocess with gnuplot?

    • @GavinFreeborn
      @GavinFreeborn  3 года назад +1

      I believe there is a program called plot2dev can be used to create pic from gnuplot but I have never tried it.

  • @lionwolf
    @lionwolf 3 года назад

    What about 3d graphics?

  • @gavinvales8928
    @gavinvales8928 3 года назад

    1:05 that's the wrong jon bentley. I only know cos I'm from England, and the jon bentley you found a picture of is an English tv presenter.

    • @GavinFreeborn
      @GavinFreeborn  3 года назад +1

      Haha ya I messed up big time on that one 🤣

  • @thirtysixnanoseconds1086
    @thirtysixnanoseconds1086 3 года назад

    lol wrong jon bentley. that guy presented fith gear in the uk

    • @GavinFreeborn
      @GavinFreeborn  3 года назад

      Haha that makes alot of sense. Think I mixed around my Wikipedia links when I was making this. I had a feeling it may be wrong... 😅

  • @NeotenicApe
    @NeotenicApe 6 месяцев назад

    Graphs ≠ plots