replacement for APLX's ⌷CHART

Learning APL or new to Dyalog? Ask "silly" questions here, without fear...

replacement for APLX's ⌷CHART

Postby shallit on Tue Apr 10, 2018 2:33 pm

What is Dyalog's replacement for ⌷CHART ? Suppose I just want a simple line graph like

⌷CHART ?⍳10

How can I do this in Dyalog?
Posts: 14
Joined: Fri Oct 27, 2017 12:25 am

Re: replacement for APLX's ⌷CHART

Postby Adam|Dyalog on Wed Apr 11, 2018 10:19 am

c←⎕NEW SharpPlot
c.DrawLineGraph ?⍳10
3500⌶c.RenderSvg 100

Here is a small utility function that lets you give it data as right argument and optionally a chart type as left argument:

      {type}Draw data;Causeway;ref;types
:If 900⌶⍬ ⍝ called monadically
Causeway←⎕NS ⍬
ref←⎕NEW Causeway.SharpPlot
types←'D'ref.⎕NL ¯3
:If 0∊⍴data
:OrIf 0∊⍴type
ref←911 ⎕SIGNAL⍨'VALID TYPES:',∊{' ',¯1↓1↓⍵⊂⍨⍵∊⎕A}¨types
:If ×≢types
:If ¯1=(4↓⊃types)(3500⌶)ref.RenderSvg 100
'RIDE browser not available'⎕SIGNAL 6
'Invalid type'⎕SIGNAL 11

SharpPlot has a lot of options. See e.g. here.
User avatar
Posts: 88
Joined: Thu Jun 25, 2015 1:13 pm

Return to New to Dyalog?

Who is online

Users browsing this forum: No registered users and 1 guest