Today is a very special occasion, as we have our fist ever guest speaker chatter, Nic, who will teach you about basic plotting in APL. Go ahead, @Nic !
Here's the setup : https://tio.run/##fVTbbhNJEH33V9TbjLGTeBxisrEQIiawXpLAOhvuEerJtMcNPRe62zcuL@wqS8J6BUIrP61ACL4AEB/gP5kfCdU9PRALRMsaz3RXnao@dapIyheCMeFJeHwMuJx2zFSL9CUdkrEDzjVGhw5k//7XuunIHhFpyhPllEraNnv2N6iRyg5eDFmgerBOJG2cBhYr2fSZfpiN5j76SaqasXkxrgDaAD2r2eTQdY3/bLpaziYf6@Xs6J3GgJMrm/wPA7qvEiEh6RpvsEg5LGJl/zxzs8O3@qw8@9yAHy2NE/cjnwoDk2c8l5fZQrR6dvReJ5fDVxs6N7cxm@bf5ezgpUnCIKYkyFMaMuThIRWJBJVASBUQiPpcsZRTHbBhzGwoywvGcs6vty5sXLz0a/u3y5tb21eu/t7Z@WP32vUbN28Rfz@g3bDH7t3nUZykD4RU/cFwNH5Y8@rLp1caZ1Z/qSw5FjIvhwW@7VXy2@x9O63isbv8eMEyjnRpqvXdnLPOd0zpe0VMShaH4I8VtRdE00IAuRK2yH2622kj9iMnIIqssYiEdEkO…
I have a copy of 17.1 installed on this computer; would you please be sure to provide the information needed to do it in a local terp instead of (just) TIO?
So, in the TIO setup, to view the chart, you need to copy/paste the output URI into your web browser address bar
Sometimes the output URI is split on multiple lines in the output, so it's important to select it with CTRL+A which selects the whole text and not simply double-clicking on it which selects a single line (at least in firefox)
That's a SharpPlot instance, with a bunch of methods and properties. You might draw another line graph, or any other kind of graph, or add some notes And finally at some point you'll output the chart in some way to an image
@AviF.S. I usually do that because when doing complex chart you usually have functions that do separate steps of work on the SharpPlot instance. Hence you want to return it to keep working on it.
But again if you're happy just to view the chart that's fine
@AviF.S. Are you using the RIDE ? If so, there can only be one window, and it doesn't pop up. When you plot a second chart, it silently redraws over the previous one
@Richard : Richard size;count;date;dates;oledates;sp;type 'date'⎕CY'dfns' dates←date¨43578+size?10×size type←'Groceries' 'Entertainment' 'Subscription'[?size⍴3] count←20+?size⍴100
oledates←{1+2 ⎕NQ'.' 'DateToIDN'⍵}¨dates ⍝ OLE dates are 1 more because Microsoft thought there was a Feb 29th, 1900 InitCauseway ⍬ sp←⎕NEW Causeway.SharpPlot sp.SplitBy⊂type ⍝ single argument must be enclosed sp.ScatterPlotStyle←Causeway.ScatterPlotStyles.(GridLines+Risers) sp.SetColors System.Drawing.Color.(Blue Red Green)
Try : Richard 20
You might want to set sp.XAxisStyle←Causeway.XAxisStyles.(Date+MonthlyTicks)
@Nic Apart from having to remove all the "Causeways" because I copied sharpplot to #, I got Undefined name: System', then did ⎕USING←'' and now have Undefined name: Drawing`
However I recommend sticking to the InitCauseway approach because code is then : - cross platform (Linux VS Windows .Net) - more similar to the C# samples in sharpplot.com
@Nic Delocalising ⎕USING in InitCauseway has also fixed the thing (can't remember when I first noticed / started ignoring it) where it would say "no in memory viewer available - saving temporary SVG..."
Richard size;count;date;dates;oledates;sp;type 'date'⎕CY'dfns' dates←date¨43578+size?10×size type←'Groceries' 'Entertainment' 'Subscription'[?size⍴3] count←20+?size⍴100
oledates←{1+2 ⎕NQ'.' 'DateToIDN'⍵}¨dates ⍝ OLE dates are 1 more because Microsoft thought there was a Feb 29th, 1900 InitCauseway ⍬ sp←⎕NEW Causeway.SharpPlot sp.SplitBy⊂type ⍝ single argument must be enclosed sp.ScatterPlotStyle←Causeway.ScatterPlotStyles.(GridLines+Risers) sp.SetColors⊂System.Drawing.Color.(Blue Red Green) sp.SetMarkers Causeway.Marker.Bullet
@Nic You have to render it as png first. Easiest is to open in a browser, screenshot, go to imgur.com/upload then paste, wait, right-click and view image, copy url, and pase only the url into a separate message here.
@ab5tract Unfortunately not. All the samples are in C#. You can refer to sharpplot.com/Languages.htm to help you translate them to APL, which is pretty straightforward.
You can also find pure-APL scripts in the Samples namespace of the SharpPlot workspace
@ab5tract Yup, and as long as you just set properties and call methods, all languages look the same. The only pitfall is to enclose a single argument, otherwise it's taken as an array of arguments.