SlideShare a Scribd company logo
Perguntas




        GD::Graph - Graph Plotting Module

       Jos´ Pedro Silva
          e                             Pedro Faria         Ulisses Costa

                              Engenharia de Linguagens
                                 Projecto integrado


                                 January 22, 2011




Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
   e                                           GD::Graph - Graph Plotting Module
Perguntas

Description



   GD::Graph is a perl5 module to create charts using the GD
   module. The following classes for graphs with axes are defined:
   GD::Graph::lines Create a line chart.
   GD::Graph::bars Create a bar chart with vertical or horizontal bars.
   GD::Graph::linespoints Combination of lines and points.
   GD::Graph::area Create a graph, representing the data as areas
                under a line.
   GD::Graph::pie Create a pie chart.




        Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
           e                                           GD::Graph - Graph Plotting Module
Perguntas

Bars


 1   sub plotPng {
 2       my $fileName = shift ;
 3       @data = ( ["1 st " ,"2 nd " ,"3 rd " ,"4 th " ,"5 th " ,"6 th " ,"7 th " , "8 th " , "9 th "] ,
 4                  [     1,       2,       5,       6,       3 , 1.5 ,         1,        3,        4]
 5               );
 6       my $mygraph = GD :: Graph :: bars - > new (600 , 400) ;
 7
 8        $mygraph - > set (
 9            x_label        = > " Contestant " ,
10            y_label        = > " Time " ,
11            title          = > " Times of the contestants " ,
12            dclrs          = > [ qw ( gold red green ) ] ,
13        ) or warn $mygraph - > error ;
14
15        my $myimage = $mygraph - > plot ( @data ) or warn $mygraph - > error ;
16
17        open ( IMG , ’>’ , $fileName ) ;
18        binmode IMG ;
19        print IMG $myimage - > png ;
20        close ( IMG ) ;
21   }




              Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
                 e                                             GD::Graph - Graph Plotting Module
Perguntas

Bars - Output




       Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
          e                                           GD::Graph - Graph Plotting Module
Perguntas

Pie


 1    sub plotPng {
 2        my $fileName = shift ;
 3        @data = ( ["1 st " ,"2 nd " ,"3 rd " ,"4 th " ,"5 th " ,"6 th " ,"7 th " , "8 th " , "9 th "] ,
 4                   [     1,       2,       5,       6,       3 , 1.5 ,         1,        3,        4]
 5                );
 6        my $mygraph = GD :: Graph :: pie - > new (600 , 400) ;
 7
 8         $mygraph - > set (
 9             title          = > " Times of the contestants " ,
10             dclrs          = > [ qw ( gold red green ) ] ,
11         ) or warn $mygraph - > error ;
12
13         my $myimage = $mygraph - > plot ( @data ) or warn $mygraph - > error ;
14
15         open ( IMG , ’>’ , $fileName ) ;
16         binmode IMG ;
17         print IMG $myimage - > png ;
18         close ( IMG ) ;
19    }




               Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
                  e                                             GD::Graph - Graph Plotting Module
Perguntas

Pie - Output




       Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
          e                                           GD::Graph - Graph Plotting Module
Perguntas

Line


 1   sub plotPng {
 2       my $fileName = shift ;
 3       @data = ( ["1 st " ,"2 nd " ,"3 rd " ,"4 th " ,"5 th " ,"6 th " ,"7 th " , "8 th " , "9 th "] ,
 4                  [     1,       2,       5,       6,       3 , 1.5 ,         1,        3,        4]
 5               );
 6       my $mygraph = GD :: Graph :: area - > new (600 , 400) ;
 7
 8        $mygraph - > set (
 9            title          = > " Times of the contestants " ,
10            dclrs          = > [ qw ( gold red green ) ] ,
11        ) or warn $mygraph - > error ;
12
13        my $myimage = $mygraph - > plot ( @data ) or warn $mygraph - > error ;
14
15        open ( IMG , ’>’ , $fileName ) ;
16        binmode IMG ;
17        print IMG $myimage - > png ;
18        close ( IMG ) ;
19   }




              Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
                 e                                             GD::Graph - Graph Plotting Module
Perguntas

Line - Output




       Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
          e                                           GD::Graph - Graph Plotting Module
Perguntas

Area


 1   sub plotPng {
 2       my $fileName = shift ;
 3       @data = ( ["1 st " ,"2 nd " ,"3 rd " ,"4 th " ,"5 th " ,"6 th " ,"7 th " , "8 th " , "9 th "] ,
 4                  [     1,       2,       5,       6,       3 , 1.5 ,         1,        3,        4]
 5               );
 6       my $mygraph = GD :: Graph :: area - > new (600 , 400) ;
 7
 8        $mygraph - > set (
 9            title          = > " Times of the contestants " ,
10            dclrs          = > [ qw ( gold red green ) ] ,
11        ) or warn $mygraph - > error ;
12
13        my $myimage = $mygraph - > plot ( @data ) or warn $mygraph - > error ;
14
15        open ( IMG , ’>’ , $fileName ) ;
16        binmode IMG ;
17        print IMG $myimage - > png ;
18        close ( IMG ) ;
19   }




              Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
                 e                                             GD::Graph - Graph Plotting Module
Perguntas

Area - Output




       Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
          e                                           GD::Graph - Graph Plotting Module
Perguntas

Points and Lines


 1   sub plotPng {
 2       my $fileName = shift ;
 3       @data = ( ["1 st " ,"2 nd " ,"3 rd " ,"4 th " ,"5 th " ,"6 th " ,"7 th " , "8 th " , "9 th "] ,
 4                  [     1,       2,       5,       6,       3 , 1.5 ,         1,        3,        4]
 5               );
 6       my $mygraph = GD :: Graph :: points - > new (600 , 400) ;
 7
 8        $mygraph - > set (
 9            title          = > " Times of the contestants " ,
10            dclrs          = > [ qw ( gold red green ) ] ,
11        ) or warn $mygraph - > error ;
12
13        my $myimage = $mygraph - > linespoints ( @data ) or warn $mygraph - > error ;
14
15        open ( IMG , ’>’ , $fileName ) ;
16        binmode IMG ;
17        print IMG $myimage - > png ;
18        close ( IMG ) ;
19   }




              Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
                 e                                             GD::Graph - Graph Plotting Module
Perguntas

Points and Lines - Output




       Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
          e                                           GD::Graph - Graph Plotting Module
Perguntas

Examples of output formats




 1   print   IMG   $graph - > plot ( @data ) -> gif ;
 2   print   IMG   $graph - > plot ( @data ) -> png ;
 3   print   IMG   $graph - > plot ( @data ) -> gd ;
 4   print   IMG   $graph - > plot ( @data ) -> gd2 ;




             Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
                e                                           GD::Graph - Graph Plotting Module
Perguntas

Methods for all graphs


   GD :: Graph :: chart− > new (width, height) Create a new object
                graph with optional width and heigth. Default width
                = 400, default height = 300. chart is either bars,
                lines, points, linespoints, area, mixed or pie.
   graph− > set text clr (colourname) Set the colour of the text.
               This will set the colour of the titles, labels, and axis
               labels to colour name. Also see the options textclr ,
               labelclr and axislabelclr .
   graph− > set title font(fontspecification) Set the font that will
               be used for the title of the chart.
   graph− > plot(data) Plot the chart, and return the GD::Image
               object.


        Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
           e                                           GD::Graph - Graph Plotting Module
Perguntas

Methods for all graphs - 2



   graph− > set(attrib1 => value1, attrib2 => value2...) Set chart
               options.
   graph− > get(attrib1, attrib2) Returns a list of the values of the
               attributes. In scalar context returns the value of the
               first attribute only.
   graph− > gd() Get the GD::Image object that is going to be used
              to draw on. You can do this either before or after
              calling the plot method, to do your own drawing.




        Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
           e                                           GD::Graph - Graph Plotting Module
Perguntas

Methods for all graphs - 3



   graph− > export format() Query the export format of the GD
               library in use. In scalar context, it returns ’gif’, ’png’
               or undefined, which is sufficient for most people’s
               use. In a list context, it returns a list of all the
               formats that are supported by the current version of
               GD. It can be called as a class or object method
   graph− > can do ttf () Returns true if the current GD library
               supports TrueType fonts, False otherwise. Can also
               be called as a class method or static method.




         Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
            e                                           GD::Graph - Graph Plotting Module
Perguntas

Options for graphs with axes



   x label, y label The labels to be printed next to, or just below, the
                 axes. Note that if you use the two axes option that
                 you need to use y 1 label and y 2 label.
   show values Set this to 1 to display the value of each data point
               above the point or bar itself.
   values space Space to insert between the data point and the value
                to print. Default: 4.
   values format How to format the values for display.
   and many more. . .




        Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
           e                                           GD::Graph - Graph Plotting Module
Perguntas

Lines with show values




 1   $mygraph - > set (
 2       x_label = > " Contestant " ,
 3       y_label = > " Time " ,
 4       values_format = > sub { return sprintf ("% d " , shift ) ; } ,
 5       values_space = > 10 ,
 6       show_values = > 1 ,
 7       title           = > " Times of the contestants " ,
 8       dclrs           = > [ qw ( gold red green ) ]
 9   ) or warn $mygraph - > error ;




        Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
           e                                           GD::Graph - Graph Plotting Module
Perguntas

Lines with show values




       Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
          e                                           GD::Graph - Graph Plotting Module
Perguntas

Legends and multiple Y values


 1   my @legend_keys = (" Nr of lines " ," Nr of comments ") ;
 2   $mygraph - > set_legend ( @legend_keys ) ;
 3   $mygraph - > set (
 4       transparent      => 1,
 5       overwrite = > 0 ,
 6       fgclr = > black ,
 7       labelclr = > black ,
 8       axislabelclr = > black ,
 9       legendclr = > black ,
10       valuesclr = > black ,
11       textclr = > black ,
12       transparent      => 1,
13       overwrite = > 0 ,
14       b argroup_spacing = > 10 ,
15       show_values      => 1,
16       values_format = > sub { return sprintf ("% d " , shift ) ; } ,
17       values_space = > 10 ,
18       x_label          = > $x_label ,
19       y_label          = > $y_label ,
20       title            = > $title ,
21       dclrs            = > [ qw ( gold red green ) ] ,
22   ) or warn $mygraph - > error ;




        Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
           e                                           GD::Graph - Graph Plotting Module
Perguntas

Legends and multiple Y values - Output




       Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
          e                                           GD::Graph - Graph Plotting Module
Perguntas

Legends and multiple Y values 2 - Output




       Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
          e                                           GD::Graph - Graph Plotting Module
Perguntas

Overwrite bars


 1   my @legend_keys = (" Nr of lines " ," Nr of comments ") ;
 2   $mygraph - > set_legend ( @legend_keys ) ;
 3   $mygraph - > set (
 4       transparent      => 1,
 5       overwrite = > 2 ,
 6       fgclr = > black ,
 7       labelclr = > black ,
 8       axislabelclr = > black ,
 9       legendclr = > black ,
10       valuesclr = > black ,
11       textclr = > black ,
12       transparent      => 1,
13       overwrite = > 0 ,
14       b argroup_spacing = > 10 ,
15       show_values      => 1,
16       values_format = > sub { return sprintf ("% d " , shift ) ; } ,
17       values_space = > 10 ,
18       x_label          = > $x_label ,
19       y_label          = > $y_label ,
20       title            = > $title ,
21       dclrs            = > [ qw ( gold red green ) ] ,
22   ) or warn $mygraph - > error ;




        Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
           e                                           GD::Graph - Graph Plotting Module
Perguntas

Overwrite bars - Output




       Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
          e                                           GD::Graph - Graph Plotting Module
Perguntas

Perguntas




                                                      ?




       Jos´ Pedro Silva, Pedro Faria, Ulisses Costa
          e                                               GD::Graph - Graph Plotting Module

More Related Content

What's hot

Mobile Game and Application with J2ME - Collision Detection
Mobile Gameand Application withJ2ME  - Collision DetectionMobile Gameand Application withJ2ME  - Collision Detection
Mobile Game and Application with J2ME - Collision Detection
Jenchoke Tachagomain
 
Mobile Game and Application with J2ME
Mobile Gameand Application with J2MEMobile Gameand Application with J2ME
Mobile Game and Application with J2ME
Jenchoke Tachagomain
 
ماترێکس به‌ کوردی ئارام
ماترێکس به‌ کوردی ئارامماترێکس به‌ کوردی ئارام
ماترێکس به‌ کوردی ئارام
Aram Jamal
 
computer graphics practicals
computer graphics practicalscomputer graphics practicals
computer graphics practicals
Manoj Chauhan
 
FANNY HANIFAH (208700530)_INVENTORY_T1
FANNY HANIFAH (208700530)_INVENTORY_T1FANNY HANIFAH (208700530)_INVENTORY_T1
FANNY HANIFAH (208700530)_INVENTORY_T1Nifya Nafhhan
 

What's hot (7)

MS2 POwer Rules
MS2 POwer RulesMS2 POwer Rules
MS2 POwer Rules
 
662305 LAB13
662305 LAB13662305 LAB13
662305 LAB13
 
Mobile Game and Application with J2ME - Collision Detection
Mobile Gameand Application withJ2ME  - Collision DetectionMobile Gameand Application withJ2ME  - Collision Detection
Mobile Game and Application with J2ME - Collision Detection
 
Mobile Game and Application with J2ME
Mobile Gameand Application with J2MEMobile Gameand Application with J2ME
Mobile Game and Application with J2ME
 
ماترێکس به‌ کوردی ئارام
ماترێکس به‌ کوردی ئارامماترێکس به‌ کوردی ئارام
ماترێکس به‌ کوردی ئارام
 
computer graphics practicals
computer graphics practicalscomputer graphics practicals
computer graphics practicals
 
FANNY HANIFAH (208700530)_INVENTORY_T1
FANNY HANIFAH (208700530)_INVENTORY_T1FANNY HANIFAH (208700530)_INVENTORY_T1
FANNY HANIFAH (208700530)_INVENTORY_T1
 

Similar to GD::Graph - Graph Plotting Module

R visualization: ggplot2, googlevis, plotly, igraph Overview
R visualization: ggplot2, googlevis, plotly, igraph OverviewR visualization: ggplot2, googlevis, plotly, igraph Overview
R visualization: ggplot2, googlevis, plotly, igraph Overview
Olga Scrivner
 
Getting more out of Matplotlib with GR
Getting more out of Matplotlib with GRGetting more out of Matplotlib with GR
Getting more out of Matplotlib with GR
Josef Heinen
 
An Introduction to Tinkerpop
An Introduction to TinkerpopAn Introduction to Tinkerpop
An Introduction to TinkerpopTakahiro Inoue
 
Python tools to deploy your machine learning models faster
Python tools to deploy your machine learning models fasterPython tools to deploy your machine learning models faster
Python tools to deploy your machine learning models faster
Jeff Hale
 
Graph analysis platform comparison, pregel/goldenorb/giraph
Graph analysis platform comparison, pregel/goldenorb/giraphGraph analysis platform comparison, pregel/goldenorb/giraph
Graph analysis platform comparison, pregel/goldenorb/giraph
Andrew Yongjoon Kong
 
K means clustering
K means clusteringK means clustering
K means clustering
Ahmedasbasb
 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2goMoriyoshi Koizumi
 
Digital Differential Analyzer Line Drawing Algorithm
Digital Differential Analyzer Line Drawing AlgorithmDigital Differential Analyzer Line Drawing Algorithm
Digital Differential Analyzer Line Drawing Algorithm
Kasun Ranga Wijeweera
 
The Web map stack on Django
The Web map stack on DjangoThe Web map stack on Django
The Web map stack on Django
Paul Smith
 
C arrays
C arraysC arrays
Seaborn graphing present
Seaborn graphing presentSeaborn graphing present
Seaborn graphing present
Yilin Zeng
 

Similar to GD::Graph - Graph Plotting Module (12)

R visualization: ggplot2, googlevis, plotly, igraph Overview
R visualization: ggplot2, googlevis, plotly, igraph OverviewR visualization: ggplot2, googlevis, plotly, igraph Overview
R visualization: ggplot2, googlevis, plotly, igraph Overview
 
Getting more out of Matplotlib with GR
Getting more out of Matplotlib with GRGetting more out of Matplotlib with GR
Getting more out of Matplotlib with GR
 
An Introduction to Tinkerpop
An Introduction to TinkerpopAn Introduction to Tinkerpop
An Introduction to Tinkerpop
 
Python tools to deploy your machine learning models faster
Python tools to deploy your machine learning models fasterPython tools to deploy your machine learning models faster
Python tools to deploy your machine learning models faster
 
Graph analysis platform comparison, pregel/goldenorb/giraph
Graph analysis platform comparison, pregel/goldenorb/giraphGraph analysis platform comparison, pregel/goldenorb/giraph
Graph analysis platform comparison, pregel/goldenorb/giraph
 
K means clustering
K means clusteringK means clustering
K means clustering
 
Transmogrify
TransmogrifyTransmogrify
Transmogrify
 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2go
 
Digital Differential Analyzer Line Drawing Algorithm
Digital Differential Analyzer Line Drawing AlgorithmDigital Differential Analyzer Line Drawing Algorithm
Digital Differential Analyzer Line Drawing Algorithm
 
The Web map stack on Django
The Web map stack on DjangoThe Web map stack on Django
The Web map stack on Django
 
C arrays
C arraysC arrays
C arrays
 
Seaborn graphing present
Seaborn graphing presentSeaborn graphing present
Seaborn graphing present
 

More from Ulisses Costa

Automatic Test Generation for Space
Automatic Test Generation for SpaceAutomatic Test Generation for Space
Automatic Test Generation for Space
Ulisses Costa
 
Automatic Test Generation for Space
Automatic Test Generation for SpaceAutomatic Test Generation for Space
Automatic Test Generation for SpaceUlisses Costa
 
Static Code Analyzer - Part IV
Static Code Analyzer - Part IVStatic Code Analyzer - Part IV
Static Code Analyzer - Part IVUlisses Costa
 
Specifying and Implementing SNOW3G with Cryptol
Specifying and Implementing SNOW3G with CryptolSpecifying and Implementing SNOW3G with Cryptol
Specifying and Implementing SNOW3G with CryptolUlisses Costa
 
Static Code Analyzer - Part III
Static Code Analyzer - Part IIIStatic Code Analyzer - Part III
Static Code Analyzer - Part IIIUlisses Costa
 
Static Code Analyzer - Part II
Static Code Analyzer - Part IIStatic Code Analyzer - Part II
Static Code Analyzer - Part IIUlisses Costa
 
Static Code Analyzer - Part I
Static Code Analyzer - Part IStatic Code Analyzer - Part I
Static Code Analyzer - Part IUlisses Costa
 
logCesium01
logCesium01logCesium01
logCesium01
Ulisses Costa
 
Cesium Log ed2
Cesium Log ed2Cesium Log ed2
Cesium Log ed2
Ulisses Costa
 
Captura de Informação em Rede
Captura de Informação em RedeCaptura de Informação em Rede
Captura de Informação em RedeUlisses Costa
 
Cryptol experience
Cryptol experienceCryptol experience
Cryptol experience
Ulisses Costa
 
Correct sorting with Frama-C
Correct sorting with Frama-CCorrect sorting with Frama-C
Correct sorting with Frama-C
Ulisses Costa
 
The Cryptol Epilogue: Swift and Bulletproof VHDL
The Cryptol Epilogue: Swift and Bulletproof VHDLThe Cryptol Epilogue: Swift and Bulletproof VHDL
The Cryptol Epilogue: Swift and Bulletproof VHDL
Ulisses Costa
 
Splint the C code static checker
Splint the C code static checkerSplint the C code static checker
Splint the C code static checker
Ulisses Costa
 
Exploring the Cryptol Toolset
Exploring the Cryptol ToolsetExploring the Cryptol Toolset
Exploring the Cryptol Toolset
Ulisses Costa
 
Specification of SNOW 3G in Cryptol
Specification of SNOW 3G in CryptolSpecification of SNOW 3G in Cryptol
Specification of SNOW 3G in CryptolUlisses Costa
 
Snort - capturar e dissecar o tráfego da rede
Snort - capturar e dissecar o tráfego da redeSnort - capturar e dissecar o tráfego da rede
Snort - capturar e dissecar o tráfego da redeUlisses Costa
 
LDAP em VDM++
LDAP em VDM++LDAP em VDM++
LDAP em VDM++
Ulisses Costa
 
Uso de Honeypots com Honeyd
Uso de Honeypots com HoneydUso de Honeypots com Honeyd
Uso de Honeypots com Honeyd
Ulisses Costa
 

More from Ulisses Costa (20)

Automatic Test Generation for Space
Automatic Test Generation for SpaceAutomatic Test Generation for Space
Automatic Test Generation for Space
 
Automatic Test Generation for Space
Automatic Test Generation for SpaceAutomatic Test Generation for Space
Automatic Test Generation for Space
 
Static Code Analyzer - Part IV
Static Code Analyzer - Part IVStatic Code Analyzer - Part IV
Static Code Analyzer - Part IV
 
Specifying and Implementing SNOW3G with Cryptol
Specifying and Implementing SNOW3G with CryptolSpecifying and Implementing SNOW3G with Cryptol
Specifying and Implementing SNOW3G with Cryptol
 
Static Code Analyzer - Part III
Static Code Analyzer - Part IIIStatic Code Analyzer - Part III
Static Code Analyzer - Part III
 
Static Code Analyzer - Part II
Static Code Analyzer - Part IIStatic Code Analyzer - Part II
Static Code Analyzer - Part II
 
Static Code Analyzer - Part I
Static Code Analyzer - Part IStatic Code Analyzer - Part I
Static Code Analyzer - Part I
 
logCesium01
logCesium01logCesium01
logCesium01
 
Cesium Log ed2
Cesium Log ed2Cesium Log ed2
Cesium Log ed2
 
Captura de Informação em Rede
Captura de Informação em RedeCaptura de Informação em Rede
Captura de Informação em Rede
 
Cryptol experience
Cryptol experienceCryptol experience
Cryptol experience
 
Correct sorting with Frama-C
Correct sorting with Frama-CCorrect sorting with Frama-C
Correct sorting with Frama-C
 
The Cryptol Epilogue: Swift and Bulletproof VHDL
The Cryptol Epilogue: Swift and Bulletproof VHDLThe Cryptol Epilogue: Swift and Bulletproof VHDL
The Cryptol Epilogue: Swift and Bulletproof VHDL
 
Splint the C code static checker
Splint the C code static checkerSplint the C code static checker
Splint the C code static checker
 
Exploring the Cryptol Toolset
Exploring the Cryptol ToolsetExploring the Cryptol Toolset
Exploring the Cryptol Toolset
 
Specification of SNOW 3G in Cryptol
Specification of SNOW 3G in CryptolSpecification of SNOW 3G in Cryptol
Specification of SNOW 3G in Cryptol
 
Snort - capturar e dissecar o tráfego da rede
Snort - capturar e dissecar o tráfego da redeSnort - capturar e dissecar o tráfego da rede
Snort - capturar e dissecar o tráfego da rede
 
LDAP em VDM++
LDAP em VDM++LDAP em VDM++
LDAP em VDM++
 
Uso de Honeypots com Honeyd
Uso de Honeypots com HoneydUso de Honeypots com Honeyd
Uso de Honeypots com Honeyd
 
Apresentacao JML
Apresentacao JMLApresentacao JML
Apresentacao JML
 

Recently uploaded

20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 

Recently uploaded (20)

20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 

GD::Graph - Graph Plotting Module

  • 1. Perguntas GD::Graph - Graph Plotting Module Jos´ Pedro Silva e Pedro Faria Ulisses Costa Engenharia de Linguagens Projecto integrado January 22, 2011 Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 2. Perguntas Description GD::Graph is a perl5 module to create charts using the GD module. The following classes for graphs with axes are defined: GD::Graph::lines Create a line chart. GD::Graph::bars Create a bar chart with vertical or horizontal bars. GD::Graph::linespoints Combination of lines and points. GD::Graph::area Create a graph, representing the data as areas under a line. GD::Graph::pie Create a pie chart. Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 3. Perguntas Bars 1 sub plotPng { 2 my $fileName = shift ; 3 @data = ( ["1 st " ,"2 nd " ,"3 rd " ,"4 th " ,"5 th " ,"6 th " ,"7 th " , "8 th " , "9 th "] , 4 [ 1, 2, 5, 6, 3 , 1.5 , 1, 3, 4] 5 ); 6 my $mygraph = GD :: Graph :: bars - > new (600 , 400) ; 7 8 $mygraph - > set ( 9 x_label = > " Contestant " , 10 y_label = > " Time " , 11 title = > " Times of the contestants " , 12 dclrs = > [ qw ( gold red green ) ] , 13 ) or warn $mygraph - > error ; 14 15 my $myimage = $mygraph - > plot ( @data ) or warn $mygraph - > error ; 16 17 open ( IMG , ’>’ , $fileName ) ; 18 binmode IMG ; 19 print IMG $myimage - > png ; 20 close ( IMG ) ; 21 } Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 4. Perguntas Bars - Output Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 5. Perguntas Pie 1 sub plotPng { 2 my $fileName = shift ; 3 @data = ( ["1 st " ,"2 nd " ,"3 rd " ,"4 th " ,"5 th " ,"6 th " ,"7 th " , "8 th " , "9 th "] , 4 [ 1, 2, 5, 6, 3 , 1.5 , 1, 3, 4] 5 ); 6 my $mygraph = GD :: Graph :: pie - > new (600 , 400) ; 7 8 $mygraph - > set ( 9 title = > " Times of the contestants " , 10 dclrs = > [ qw ( gold red green ) ] , 11 ) or warn $mygraph - > error ; 12 13 my $myimage = $mygraph - > plot ( @data ) or warn $mygraph - > error ; 14 15 open ( IMG , ’>’ , $fileName ) ; 16 binmode IMG ; 17 print IMG $myimage - > png ; 18 close ( IMG ) ; 19 } Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 6. Perguntas Pie - Output Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 7. Perguntas Line 1 sub plotPng { 2 my $fileName = shift ; 3 @data = ( ["1 st " ,"2 nd " ,"3 rd " ,"4 th " ,"5 th " ,"6 th " ,"7 th " , "8 th " , "9 th "] , 4 [ 1, 2, 5, 6, 3 , 1.5 , 1, 3, 4] 5 ); 6 my $mygraph = GD :: Graph :: area - > new (600 , 400) ; 7 8 $mygraph - > set ( 9 title = > " Times of the contestants " , 10 dclrs = > [ qw ( gold red green ) ] , 11 ) or warn $mygraph - > error ; 12 13 my $myimage = $mygraph - > plot ( @data ) or warn $mygraph - > error ; 14 15 open ( IMG , ’>’ , $fileName ) ; 16 binmode IMG ; 17 print IMG $myimage - > png ; 18 close ( IMG ) ; 19 } Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 8. Perguntas Line - Output Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 9. Perguntas Area 1 sub plotPng { 2 my $fileName = shift ; 3 @data = ( ["1 st " ,"2 nd " ,"3 rd " ,"4 th " ,"5 th " ,"6 th " ,"7 th " , "8 th " , "9 th "] , 4 [ 1, 2, 5, 6, 3 , 1.5 , 1, 3, 4] 5 ); 6 my $mygraph = GD :: Graph :: area - > new (600 , 400) ; 7 8 $mygraph - > set ( 9 title = > " Times of the contestants " , 10 dclrs = > [ qw ( gold red green ) ] , 11 ) or warn $mygraph - > error ; 12 13 my $myimage = $mygraph - > plot ( @data ) or warn $mygraph - > error ; 14 15 open ( IMG , ’>’ , $fileName ) ; 16 binmode IMG ; 17 print IMG $myimage - > png ; 18 close ( IMG ) ; 19 } Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 10. Perguntas Area - Output Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 11. Perguntas Points and Lines 1 sub plotPng { 2 my $fileName = shift ; 3 @data = ( ["1 st " ,"2 nd " ,"3 rd " ,"4 th " ,"5 th " ,"6 th " ,"7 th " , "8 th " , "9 th "] , 4 [ 1, 2, 5, 6, 3 , 1.5 , 1, 3, 4] 5 ); 6 my $mygraph = GD :: Graph :: points - > new (600 , 400) ; 7 8 $mygraph - > set ( 9 title = > " Times of the contestants " , 10 dclrs = > [ qw ( gold red green ) ] , 11 ) or warn $mygraph - > error ; 12 13 my $myimage = $mygraph - > linespoints ( @data ) or warn $mygraph - > error ; 14 15 open ( IMG , ’>’ , $fileName ) ; 16 binmode IMG ; 17 print IMG $myimage - > png ; 18 close ( IMG ) ; 19 } Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 12. Perguntas Points and Lines - Output Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 13. Perguntas Examples of output formats 1 print IMG $graph - > plot ( @data ) -> gif ; 2 print IMG $graph - > plot ( @data ) -> png ; 3 print IMG $graph - > plot ( @data ) -> gd ; 4 print IMG $graph - > plot ( @data ) -> gd2 ; Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 14. Perguntas Methods for all graphs GD :: Graph :: chart− > new (width, height) Create a new object graph with optional width and heigth. Default width = 400, default height = 300. chart is either bars, lines, points, linespoints, area, mixed or pie. graph− > set text clr (colourname) Set the colour of the text. This will set the colour of the titles, labels, and axis labels to colour name. Also see the options textclr , labelclr and axislabelclr . graph− > set title font(fontspecification) Set the font that will be used for the title of the chart. graph− > plot(data) Plot the chart, and return the GD::Image object. Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 15. Perguntas Methods for all graphs - 2 graph− > set(attrib1 => value1, attrib2 => value2...) Set chart options. graph− > get(attrib1, attrib2) Returns a list of the values of the attributes. In scalar context returns the value of the first attribute only. graph− > gd() Get the GD::Image object that is going to be used to draw on. You can do this either before or after calling the plot method, to do your own drawing. Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 16. Perguntas Methods for all graphs - 3 graph− > export format() Query the export format of the GD library in use. In scalar context, it returns ’gif’, ’png’ or undefined, which is sufficient for most people’s use. In a list context, it returns a list of all the formats that are supported by the current version of GD. It can be called as a class or object method graph− > can do ttf () Returns true if the current GD library supports TrueType fonts, False otherwise. Can also be called as a class method or static method. Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 17. Perguntas Options for graphs with axes x label, y label The labels to be printed next to, or just below, the axes. Note that if you use the two axes option that you need to use y 1 label and y 2 label. show values Set this to 1 to display the value of each data point above the point or bar itself. values space Space to insert between the data point and the value to print. Default: 4. values format How to format the values for display. and many more. . . Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 18. Perguntas Lines with show values 1 $mygraph - > set ( 2 x_label = > " Contestant " , 3 y_label = > " Time " , 4 values_format = > sub { return sprintf ("% d " , shift ) ; } , 5 values_space = > 10 , 6 show_values = > 1 , 7 title = > " Times of the contestants " , 8 dclrs = > [ qw ( gold red green ) ] 9 ) or warn $mygraph - > error ; Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 19. Perguntas Lines with show values Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 20. Perguntas Legends and multiple Y values 1 my @legend_keys = (" Nr of lines " ," Nr of comments ") ; 2 $mygraph - > set_legend ( @legend_keys ) ; 3 $mygraph - > set ( 4 transparent => 1, 5 overwrite = > 0 , 6 fgclr = > black , 7 labelclr = > black , 8 axislabelclr = > black , 9 legendclr = > black , 10 valuesclr = > black , 11 textclr = > black , 12 transparent => 1, 13 overwrite = > 0 , 14 b argroup_spacing = > 10 , 15 show_values => 1, 16 values_format = > sub { return sprintf ("% d " , shift ) ; } , 17 values_space = > 10 , 18 x_label = > $x_label , 19 y_label = > $y_label , 20 title = > $title , 21 dclrs = > [ qw ( gold red green ) ] , 22 ) or warn $mygraph - > error ; Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 21. Perguntas Legends and multiple Y values - Output Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 22. Perguntas Legends and multiple Y values 2 - Output Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 23. Perguntas Overwrite bars 1 my @legend_keys = (" Nr of lines " ," Nr of comments ") ; 2 $mygraph - > set_legend ( @legend_keys ) ; 3 $mygraph - > set ( 4 transparent => 1, 5 overwrite = > 2 , 6 fgclr = > black , 7 labelclr = > black , 8 axislabelclr = > black , 9 legendclr = > black , 10 valuesclr = > black , 11 textclr = > black , 12 transparent => 1, 13 overwrite = > 0 , 14 b argroup_spacing = > 10 , 15 show_values => 1, 16 values_format = > sub { return sprintf ("% d " , shift ) ; } , 17 values_space = > 10 , 18 x_label = > $x_label , 19 y_label = > $y_label , 20 title = > $title , 21 dclrs = > [ qw ( gold red green ) ] , 22 ) or warn $mygraph - > error ; Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 24. Perguntas Overwrite bars - Output Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module
  • 25. Perguntas Perguntas ? Jos´ Pedro Silva, Pedro Faria, Ulisses Costa e GD::Graph - Graph Plotting Module