Alert - I have split up this Huge website into smaller ones. Please check out the new site URLs on the Home page for the latest course content. This website will not be updated anymore. Thanks for your patience and support! 🙏
PlotX3D is a collection of Observable notebooks developed by Mark McClure, each of which defines functions that work well together. We need to import those notebooks into our work here and then use those functions to create the shapes we need.
Plot.plot({grid:true,inset:10,//aspectRatio: 0.05,color: {legend:true},marks: [ Plot.frame(), Plot.rectY(df_penguins, Plot.binX({y:"count"}, {x:"body_mass_g"}, {color:"species"}, {fill:"species"}) ), Plot.ruleY([0],) ],title:"For charts, an informative title",subtitle:"Subtitle to follow with additional context",caption:"Figure 2. A chart with a title, subtitle, and caption.",})
RuntimeError: Failed to fetch
OJS Runtime Error
Failed to fetch
Trying to master the syntax, step by step:
Plot.boxX(// Data df_penguins,// Aesthetics {x:"body_mass_g",y:"species",fill:"species",sort: {y:"x"}})// Plot options, concatenated.plot({title:"Box Plot in Observable",subtitle:"Getting hold of the Syntax",caption:"Box Plot on Log scale",height:400,marginLeft:100,// scalesx:{type:"log",}})
RuntimeError: Failed to fetch
OJS Runtime Error
Failed to fetch
Let’s try the same plot with facetting, AND with change in colour palette:
Plot.boxX(// Data df_penguins,// Aesthetics {x:"body_mass_g",y:"species",fy:"island",fill:"species",sort: {y:"x"}})// Plot options, concatenated.plot({title:"Box Plot in Observable",subtitle:"Getting hold of the Syntax",caption:"Box Plot on Log scale",// scalesx:{type:"log"}})
RuntimeError: Failed to fetch
OJS Runtime Error
Failed to fetch
Plot.plot({//plots to overlay, inside "marks". Pass data for each! No inheritance!marks: [ Plot.ruleY([0]),// x-axis intercept!! Plot.areaY(aapl, {x:"Date",y:"Close",fillOpacity:0.2}), Plot.lineY(aapl, {x:"Date",y:"Close"}) ],y: {type:"log",domain: [50,300],grid:true }})