Chart with two Y-axis without grid-lines

General APL language issues

Chart with two Y-axis without grid-lines

Postby Leo on Mon Jul 23, 2018 3:26 pm

Hallo APL/SharpPlot-Experten,
Meine Frage: Wie kann man die Y-Grid Linien der ALFSK-Achse Unterdrücken?

      ∇ Plot2Axes
[1]
[2] X←0 0.06745 0.0832688 0.1053924 0.1376548 0.1873548 0.2698 0.4215696 0.7494476 1.68625 2.84 4.26 5.68 7.1 8.52 9.94
11.36 12.78 13.950009 14.0685506 14.1553268 14.1870922
[3] YSK←0 0.1457 0.1685 0.1958 0.2278 0.263 0.2948 0.2978 0.1689 ¯0.6279 ¯1.9673 ¯3.8605 ¯5.9052 ¯8.0473 ¯10.259
¯12.5234 ¯14.8297 ¯17.1702 ¯19.1205 ¯19.3191 ¯19.4646 ¯19.5179
[4] ALFSK←71.7635 57.0532 53.463 48.374 40.8926 29.5966 12.8602 ¯8.766 ¯30.0107 ¯46.0378 ¯51.5028 ¯54.3731 ¯55.9271
¯56.9257 ¯57.6304 ¯58.1628 ¯58.5803 ¯58.918 ¯59.1546 ¯59.1757 ¯59.1923 ¯59.1983
[5] ⍝ ============================================================================================
[6] ⎕USING←'System.Drawing,system.drawing.dll' 'System.Drawing.Imaging' 'Causeway,sharpplot.dll'
[7] ⎕USING,←('Causeway,sharpplot.dll')('CausewayViewer,sharpplot.dll')
[8] ⎕USING,←'System.Windows.Forms,System.Windows.Forms.dll' 'System.Drawing,System.Drawing.dll' ''
[9] ⍝ ============================================================================================
[10] sp←⎕NEW Causeway.SharpPlot(700 500)
[11] sp.SetFrameBackground System.Drawing.Color.Black Causeway.FillStyle.Solid 0.5
[12] sp.FrameStyle←Causeway.FrameStyles.Boxed
[13] sp.SetMargins 90 70 60 130 ⍝ top - bottom - left - righ (Randabstände)
[14] sp.Gutter←10 ⍝ Abstand Blattrand zu Rahmen
[15]
[16] sp.Heading←'Test-Example' ⍝ Diagramm-Überschrift
[17] sp.SetHeadingNudge(0,-20) ⍝ Position der Überschrift (horizontal,vertikal)
[18] sp.SetHeadingFont'Times' 16 System.Drawing.FontStyle.Regular System.Drawing.Color.Black
[19]
[20] ⍝ Plot Kurve 1
[21] ⍝ Beschreibung und Beschriftungsstil der Achsen:
[22] sp.SetCaptionFont('Arial')(13)(System.Drawing.FontStyle.Regular)(System.Drawing.Color.Black)
[23] sp.XCaption←'X[mm]' ⍝ Überschrift der X-Achse
[24] sp.YCaption←'YSK[mm]' ⍝ Überschrift der Y-Achse
[25] sp.XIntercept←¯0.2 ⍝ Schnittpunkt der X-Achse
[26] sp.YIntercept←0 ⍝ Schnittpunkt der Y-Achse
[27] sp.SetXRange(0)(15) ⍝ Scalenbereich der X-Achse (Xmin - Xmax)
[28] sp.SetYRange(20)(¯20) ⍝ Scalenbereich der Y-Achse (Ymin - Ymax)
[29] sp.XAxisStyle←Causeway.XAxisStyles.GridLines ⍝ X-Gitterlinien
[30] sp.YAxisStyle←Causeway.YAxisStyles.GridLines ⍝ Y-Gitterlinien
[31]
[32] sp.LineGraphStyle←Causeway.LineGraphStyles.(Markers)
[33] sp.DrawLineGraph(,⊂YSK)(X) ⍝ Zeichne Kurve1
[34]
[35] ⍝ Plot Kurve 2
[36] ⍝ Beschreibung und Beschriftungsstil der Achse 2:
[37] sp.NewYAxis
[38] sp.SetCaptionFont('Arial')(13)(System.Drawing.FontStyle.Regular)(System.Drawing.Color.Red)
[39] sp.YCaption←'ALFSK[grd]' ⍝ Überschrift der Y-Achse
[40] sp.XIntercept←15.2 ⍝ Schnittpunkt der Y-Achse
[41] sp.YIntercept←0 ⍝ Schnittpunkt der Y-Achse
[42] sp.SetYRange(90)(¯90) ⍝ Scalenbereich der Y-Achse (Ymin - Ymax)
[43] sp.DrawLineGraph(,⊂ALFSK)(X) ⍝ Zeichne Kurve2
[44]
[45] viewer←⎕NEW SharpPlotViewer
[46] viewer.SharpPlot←sp
[47] viewer.Show ⍬

Many thanks for your help!
greeting
Leo
Leo
 
Posts: 38
Joined: Mon Sep 18, 2017 12:10 pm

Re: Chart with two Y-axis without grid-lines

Postby Nicolas|Dyalog on Thu Aug 02, 2018 10:51 am

The strict way to remove Y gridlines on the second graph is to reset the YAxisStyle
      sp.YAxisStyle←0

before the second call to sp.DrawLineGraph on line [43]

However the cool thing you probably want to use is to synchronise the new Y axis tickmarks with the previous one by modifying the YAxisStyle:
      sp.YAxisStyle+←Causeway.YAxisStyles.Synchronised
Nicolas|Dyalog
 
Posts: 17
Joined: Wed Sep 10, 2008 9:39 am

Re: Chart with two Y-axis without grid-lines

Postby Leo on Mon Aug 06, 2018 2:44 pm

Hello Nick,
Thank you for the note about synchronizing the axes.
SharpPlot is indeed a great graphics program.
Best regards
Leo
Leo
 
Posts: 38
Joined: Mon Sep 18, 2017 12:10 pm


Return to Language

Who is online

Users browsing this forum: No registered users and 1 guest