P1D 2D array with errors filled as area
Code: "points3.py". Programming language: Python
DMelt Version 1. Last modified: 12/08/2015. License: Pro
https://datamelt.org/code/cache/points3_3102.py
To run this script using the DMelt IDE,
copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.
from java.awt import Color,Font
from jhplot import HPlot,P1D
# make main canvas
c1 = HPlot("Canvas",600,400,2, 1)
c1.visible(1)
c1.setAutoRange()
c1.viewHisto(0); # make sure starts from 0
c1.setGTitle("Fill area between errors in y", Color.blue) #put title
c1.setGrid(0,0)
c1.setGrid(1,0)
# WWW directory with the data files
DataDir="http://datamelt.org/examples/data/";
# show points with statistical errors in y
c1.cd(1,1)
c1.setAutoRange()
c1.setGrid(0,0)
c1.setGrid(1,0)
p1= P1D("File data2.d", DataDir+"data2.d");
p1.setErr(1)
# set color blue and transparency level 50%
p1.setErrFillColor(Color.blue,0.5)
c1.draw(p1)
# show points with statistical and systematical errors
c1.cd(2,1)
c1.setAutoRange()
c1.setGrid(0,0)
c1.setGrid(1,0)
p2= P1D("File data4.d", DataDir+"data4.d");
p2.setErr(1)
p2.setErrFillColor(Color.green,0.5)
p2.setErrSysFillColor(Color.yellow,0.5)
p2.setColor(Color.blue)
c1.draw(p2)
# export to some image (png,eps,pdf,jpeg...)
# c1.export(Editor.DocMasterName()+".png")
# view in external viewer
# a=IView(Editor.DocMasterName()+".png")
You see the box below because you did not login.