SharpPlot, tables within the graphic
Posted: Mon Jan 15, 2018 1:23 pm
Version: 16.0.31693.0 64 Unicode
Created: Dec 3 2017 at 19:58:11
Windows 7
Subject: SharpPlot, tables within the graphic
Hello DyalogAPL'er
I have some basic questions for me about creating 2D charts with SharpPlot.
The example shown "DProfil" is executable, but should still be supplemented.
What I have not been able to figure out yet is how to create tables and insert them into the 2D diagram.
1st question: How to create a table for the "profile coordinates"?
The values X, Y1 and Y2 should be written in a 3-column table with the respective headings X, Y1 and Y2 and finally put anywhere in the diagram.
2nd question: How to create a table for the "profile parameters". In the first column should be the names, in the second column the corresponding values
For the tables, which can be arranged anywhere in the diagram, I kept the place in the code list.
3rd question: The pdf diagram appears very small in the lower left corner. How do you get the diagram to fill the entire paper surface (A7)?
4th question: On the X-axis the zero (0) is omitted. How can I get the 0 to appear?
Many thanks in advance for your help!
Leo
Created: Dec 3 2017 at 19:58:11
Windows 7
Subject: SharpPlot, tables within the graphic
Hello DyalogAPL'er
I have some basic questions for me about creating 2D charts with SharpPlot.
The example shown "DProfil" is executable, but should still be supplemented.
What I have not been able to figure out yet is how to create tables and insert them into the 2D diagram.
1st question: How to create a table for the "profile coordinates"?
The values X, Y1 and Y2 should be written in a 3-column table with the respective headings X, Y1 and Y2 and finally put anywhere in the diagram.
2nd question: How to create a table for the "profile parameters". In the first column should be the names, in the second column the corresponding values
For the tables, which can be arranged anywhere in the diagram, I kept the place in the code list.
DProfil;dat;sp;⎕USING;XY;X;Y1;Y2;XY1Y2
⍝ D:\DyalogAPL\ws3\SPTutorial.dws --- DProfil
⍝ Profilkoordinaten:
X←0 0.01 0.02 0.05 0.1 0.25 0.5 0.6 0.7 0.8 0.9 1
Y1←0 0.0307 0.0411 0.0579 0.0699 0.074 0.0552 0.0456 0.0367 0.0292 0.0229 0.0176
Y2←0 ¯0.0307 ¯0.0411 ¯0.0579 ¯0.0699 ¯0.074 ¯0.0552 ¯0.0456 ¯0.0367 ¯0.0292 ¯0.0229 ¯0.0176
⍝ Profilparameter:
XDMAX←0.19 ⍝ Testeingabe
DMAX←0.15 ⍝ Testeingabe
RN←0.4 ⍝ Testeingabe
RH←0.11737 ⍝ Testeingabe
WA←6 ⍝ Testeingabe
⍝ ⍝ = INIT ===============================================================================
⎕USING←',sharpplot.dll' ',system.drawing.dll' ⍝ ⎕USING: Aufruf der .NET-Suchpfade für sp-Namespaces
⎕USING,←('Causeway,sharpplot.dll')('CausewayViewer,sharpplot.dll')
⎕USING,←'System.Windows.Forms,System.Windows.Forms.dll' 'System.Drawing,System.Drawing.dll' ''
⍝ ======================================================================================
⍝ PaperSize:
⍝ sp←⎕NEW Causeway.SharpPlot
sp←⎕NEW SharpPlot(PaperSize.Landscape⊂PaperSize.A7) ⍝ DIN A4-Format 298x211 mm
⍝ Heading: ------------------------------------------------------------------------------
sp.Heading←'D-Profil'
sp.SetHeadingFont'Arial' 12 System.Drawing.FontStyle.Regular System.Drawing.Color.Green
sp.SetHeadingNudge(0,-280) ⍝ Position der Überschrift (horizontal,vertikal)
⍝ Subheading: ---------------------------------------------------------------------------
sp.Subheading←'Grundprofil'
⍝ Footnote: -----------------------------------------------------------------------------
sp.Footnote←'D:\DyalogAPL\ws3\SPTutorial.dws --- DProfil'
sp.SetFootnoteFont'Arial' 4 System.Drawing.FontStyle.Regular System.Drawing.Color.Black
sp.FootnoteStyle←Causeway.FootnoteStyles.Right
⍝ Data Table 1: Profilkoordinaten -------------------------------------------------------
⍝ Data Table 2: Profilparameter ---------------------------------------------------------
⍝ GridLines: ----------------------------------------------------------------------------
sp.LineGraphStyle←Causeway.LineGraphStyles.GridLines
⍝ Margins (Ränder) ----------------------------------------------------------------------
sp.SetMargins 30 40 50 60 ⍝ top - bottom - left - right
⍝ Axis: ---------------------------------------------------------------------------------
sp.XAxisStyles←Causeway.XAxisStyles.CenteredCaption
sp.SetAxisStyle(Color.Black,LineStyle.Solid,0.8)
sp.XCaption←'X[-]' ⍝ Beschriftung der X-Achse
sp.YCaption←'Y[-]' ⍝ Beschriftung der Y-Achse
sp.XIntercept←0 ⍝ Schnittpunkt der Y-Achse mit der X-Achse
sp.YIntercept←¯0.3 ⍝ Schnittpunkt der X-Achse mit der Y-Achse
sp.SetXRange(0 1) ⍝ Scala der X-Achse
sp.SetYRange(¯0.3 0.3) ⍝ Scala der Y-Achse
⍝ Draw: ---------------------------------------------------------------------------------
sp.SetColors⊂System.Drawing.Color.Navy
sp.SetLineStyles⊂Causeway.LineStyle.(Solid)
sp.SetPenWidths⊂0.6 ⍝ Liniendicke Profil
sp.DrawLineGraph Y1 X ⍝ zeichnet Y1 vs. X
sp.DrawLineGraph Y2 X ⍝ zeichnet Y1 vs. X
⍝ = Output =============================================================================
⍝ - Graphic in *.png - write file ------------------------------------------------------
sp.SaveImage'D:\DyalogAPL\ws3\DProfil.png'System.Drawing.Imaging.ImageFormat.Png
⍝ - Graphic in *.pdf - write file ------------------------------------------------------
sp.SavePdf⊂'D:\DyalogAPL\ws3\DProfil.pdf'
⍝ - Graphic on screen show -------------------------------------------------------------
viewer←⎕NEW SharpPlotViewer
viewer.SharpPlot←sp
viewer.Show ⍬
⍝ ======================================================================================
3rd question: The pdf diagram appears very small in the lower left corner. How do you get the diagram to fill the entire paper surface (A7)?
4th question: On the X-axis the zero (0) is omitted. How can I get the 0 to appear?
Many thanks in advance for your help!
Leo