%3CLINGO-SUB%20id%3D%22lingo-sub-29709%22%20slang%3D%22en-US%22%3EMaking%20Anonymous%20Graphs%20in%20JMP%208%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-29709%22%20slang%3D%22en-US%22%3E%3CP%3EHow%20can%20I%20use%20JSL%20to%20make%20a%20graph%20with%20no%20labels%20on%20the%20axes%3F%20There%20are%20a%20lot%20of%20reasons%20you%20might%20want%20to%20do%20this%3B%20maybe%20you%20are%20building%20a%20dashboard%20control%20that%20shows%20a%20custom%20picture%2C%20or%20maybe%20you%20have%20data%20that%20needs%20no%20labels.%20%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EAnyway%2C%20there%20are%20two%20places%20to%20look%20to%20make%20the%20labels%20go%20away%20%E2%80%93%20the%20tick%20mark%20labels%20(0%2C%2010%2C%2020%2C%20%E2%80%A6%20100)%20and%20the%20axis%20label%20(a%20variable%20name%20like%20Height).%20%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3ELet%E2%80%99s%20use%20the%20JSL%20Graph%20Box%20command%20to%20create%20the%20graph%20like%20this%20(taken%20directly%20from%20the%20Help-%26gt%3BIndexes-%26gt%3BJSL%20Functions-%26gt%3BGraph%20Box%20description)%3A%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CPRE%3E%3CBR%20%2F%3E%3C%2FPRE%3E%3C%2FP%3E%3CP%3ENew%20Window(%20%22Example%22%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20Graph%20Box(%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20Frame%20Size(%20300%2C%20300%20)%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20xaxis(show%20major%20ticks(false)%2Cshow%20minor%20ticks(false)%2Cshow%20labels(false))%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20yaxis(show%20major%20ticks(false)%2Cshow%20minor%20ticks(false)%2Cshow%20labels(false))%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20Marker(%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Marker%20State(%203%20)%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B11%2044%2077%5D%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B75%2025%2050%5D%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20)%3B%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20Pen%20Color(%20%22Blue%22%20)%3B%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20Line(%20%5B10%2030%2070%5D%2C%20%5B88%2022%2044%5D%20)%3B%3C%2FP%3E%3CP%3E%20%20%20%20%20%20)%3C%2FP%3E%3CP%3E)%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CIMG%20width%3D%22364%22%20height%3D%22355%22%20style%3D%22border%3A%200px%3Bpadding-left%3A%205px%3Bpadding-right%3A%205px%22%20src%3D%22http%3A%2F%2Fblogs.sas.com%2Fjmp%2Fuploads%2Fimage001.gif%22%20alt%3D%22%22%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3ETo%20eliminate%20the%20tick%20mark%20labels%2C%20add%20two%20commands%20sent%20to%20the%20x%20and%20y%20axes%3A%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%20%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CPRE%3ENew%20Window(%20%22Example%22%2C%3C%2FPRE%3E%3C%2FP%3E%3CP%3E%20%20%20%20%20%20Graph%20Box(%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20Frame%20Size(%20300%2C%20300%20)%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20xaxis(show%20major%20ticks(false)%2Cshow%20minor%20ticks(false)%2Cshow%20labels(false))%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20yaxis(show%20major%20ticks(false)%2Cshow%20minor%20ticks(false)%2Cshow%20labels(false))%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20Marker(%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Marker%20State(%203%20)%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B11%2044%2077%5D%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B75%2025%2050%5D%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20)%3B%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20Pen%20Color(%20%22Blue%22%20)%3B%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20Line(%20%5B10%2030%2070%5D%2C%20%5B88%2022%2044%5D%20)%3B%3C%2FP%3E%3CP%3E%20%20%20%20%20%20)%3C%2FP%3E%3CP%3E)%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CIMG%20width%3D%22346%22%20height%3D%22335%22%20style%3D%22border%3A%200px%3Bpadding-left%3A%205px%3Bpadding-right%3A%205px%22%20src%3D%22http%3A%2F%2Fblogs.sas.com%2Fjmp%2Fuploads%2Fimage002.gif%22%20alt%3D%22%22%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EAnd%20to%20eliminate%20the%20axis%20labels%2C%20add%20two%20more%20commands%20sent%20to%20the%20axes%3A%20%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%20%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CPRE%3E%3C%2FPRE%3E%3C%2FP%3E%3CP%3ENew%20Window(%20%22Example%22%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20g%20%3D%20Graph%20Box(%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20Frame%20Size(%20300%2C%20300%20)%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20xaxis(show%20major%20ticks(false)%2Cshow%20minor%20ticks(false)%2Cshow%20labels(false))%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20yaxis(show%20major%20ticks(false)%2Cshow%20minor%20ticks(false)%2Cshow%20labels(false))%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20Marker(%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Marker%20State(%203%20)%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B11%2044%2077%5D%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B75%2025%2050%5D%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20)%3B%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20Pen%20Color(%20%22Blue%22%20)%3B%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20Line(%20%5B10%2030%2070%5D%2C%20%5B88%2022%2044%5D%20)%3B%3C%2FP%3E%3CP%3E%20%20%20%20%20%20)%3C%2FP%3E%3CP%3E)%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3Eg%5Baxis%20box(1)%5D%26lt%3B%3CREMOVE%20axis%3D%22%22%20label%3D%22%22%3E%3C%2FREMOVE%3E%3C%2FP%3E%3CP%3Eg%5Baxis%20box(2)%5D%20%26lt%3B%26lt%3B%20remove%20axis%20label%3B%3C%2FP%3E%3CP%3E%2F%2F%20you%20could%20remove%20the%20tick%20mark%20labels%20this%20way%2C%20especially%20if%20you%20are%20not%20using%20the%20Graph%20Box%20command%3C%2FP%3E%3CP%3E%2F%2F%20g%5Bframebox(1)%5D%20%26lt%3B%26lt%3B%20xaxis(show%20major%20ticks(false)%2Cshow%20minor%20ticks(false)%2Cshow%20labels(false))%3B%3C%2FP%3E%3CP%3E%2F%2F%20g%5Bframebox(1)%5D%20%26lt%3B%26lt%3B%20yaxis(show%20major%20ticks(false)%2Cshow%20minor%20ticks(false)%2Cshow%20labels(false))%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CIMG%20width%3D%22331%22%20height%3D%22331%22%20style%3D%22border%3A%200px%3Bpadding-left%3A%205px%3Bpadding-right%3A%205px%22%20src%3D%22http%3A%2F%2Fblogs.sas.com%2Fjmp%2Fuploads%2Fimage006.gif%22%20alt%3D%22%22%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E(Bonus)%3C%2FSTRONG%3E%20To%20remove%20the%20frame%20as%20well%2C%20send%20four%20commands%20to%20the%20frame%3A%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%20%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CPRE%3E%3C%2FPRE%3E%3C%2FP%3E%3CP%3ENew%20Window(%20%22Example%22%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20g%20%3D%20Graph%20Box(%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20Frame%20Size(%20300%2C%20300%20)%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20xaxis(show%20major%20ticks(false)%2Cshow%20minor%20ticks(false)%2Cshow%20labels(false))%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20yaxis(show%20major%20ticks(false)%2Cshow%20minor%20ticks(false)%2Cshow%20labels(false))%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20Marker(%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Marker%20State(%203%20)%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B11%2044%2077%5D%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B75%2025%2050%5D%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20)%3B%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20Pen%20Color(%20%22Blue%22%20)%3B%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20Line(%20%5B10%2030%2070%5D%2C%20%5B88%2022%2044%5D%20)%3B%3C%2FP%3E%3CP%3E%20%20%20%20%20%20)%3C%2FP%3E%3CP%3E)%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3Eg%5Baxis%20box(1)%5D%20%26lt%3B%26lt%3B%20remove%20axis%20label%3B%3C%2FP%3E%3CP%3Eg%5Baxis%20box(2)%5D%20%26lt%3B%26lt%3B%20remove%20axis%20label%3B%3C%2FP%3E%3CP%3Eg%5Bframe%20box(1)%5D%20%26lt%3B%26lt%3B%20left(0)%3B%3C%2FP%3E%3CP%3Eg%5Bframe%20box(1)%5D%20%26lt%3B%26lt%3B%20right(0)%3B%3C%2FP%3E%3CP%3Eg%5Bframe%20box(1)%5D%20%26lt%3B%26lt%3B%20top(0)%3B%3C%2FP%3E%3CP%3Eg%5Bframe%20box(1)%5D%20%26lt%3B%26lt%3B%20bottom(0)%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CIMG%20width%3D%22301%22%20height%3D%22301%22%20style%3D%22border%3A%200px%3Bpadding-left%3A%205px%3Bpadding-right%3A%205px%22%20src%3D%22http%3A%2F%2Fblogs.sas.com%2Fjmp%2Fuploads%2Fimage008.gif%22%20alt%3D%22%22%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EHere%20is%20a%20complete%20example%20with%20a%20slider%20to%20make%20it%20do%20something%3A%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%20%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CPRE%3E%3C%2FPRE%3E%3C%2FP%3E%3CP%3Eg%20%3D%20Graph%20Box(%3C%2FP%3E%3CP%3E%20%20%20%20%20%20Frame%20Size(%20100%2C%2020%20)%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20Pen%20Color(%20%22Blue%22%20)%3B%3C%2FP%3E%3CP%3E%20%20%20%20%20%20Y%20Function(%2050%20%2B%2050*Sin(%20x*SliderValue%20)%2C%20x%20)%3B%20%2F%2F%20graph%20is%20a%20sin%20wave%2C%20period%20depends%20on%20SliderValue%3C%2FP%3E%3CP%3E)%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%2F%2F%20remove%20adornments%20from%20graph%3C%2FP%3E%3CP%3Eg%5Bframebox(%201%20)%5D%20%26lt%3B%26lt%3B%20xaxis(%20show%20major%20ticks(%20false%20)%2C%20show%20minor%20ticks(%20false%20)%2C%20show%20labels(%20false%20)%20)%3B%3C%2FP%3E%3CP%3Eg%5Bframebox(%201%20)%5D%20%26lt%3B%26lt%3B%20yaxis(%20show%20major%20ticks(%20false%20)%2C%20show%20minor%20ticks(%20false%20)%2C%20show%20labels(%20false%20)%20)%3B%3C%2FP%3E%3CP%3Eg%5Baxis%20box(%201%20)%5D%20%26lt%3B%26lt%3B%20remove%20axis%20label%3B%3C%2FP%3E%3CP%3Eg%5Baxis%20box(%202%20)%5D%20%26lt%3B%26lt%3B%20remove%20axis%20label%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%2F%2F%20hide%20the%20inner%20border%3C%2FP%3E%3CP%3Eg%5Bframe%20box(%201%20)%5D%20%26lt%3B%26lt%3B%20Left(%200%20)%3B%20%2F%2F%20no%20line%20on%20left%2C%20etc%3C%2FP%3E%3CP%3Eg%5Bframe%20box(%201%20)%5D%20%26lt%3B%26lt%3B%20Right(%200%20)%3B%3C%2FP%3E%3CP%3Eg%5Bframe%20box(%201%20)%5D%20%26lt%3B%26lt%3B%20top(%200%20)%3B%3C%2FP%3E%3CP%3Eg%5Bframe%20box(%201%20)%5D%20%26lt%3B%26lt%3B%20bottom(%200%20)%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%2F%2F%20shrink%20and%20hide%20the%20outer%20border%20too%3C%2FP%3E%3CP%3Eg%5BBorder%20Box(%201%20)%5D%20%26lt%3B%26lt%3B%20Left(%200%20)%3B%20%2F%2F%20no%20space%20on%20left%2C%20etc%3C%2FP%3E%3CP%3Eg%5BBorder%20Box(%201%20)%5D%20%26lt%3B%26lt%3B%20Right(%200%20)%3B%3C%2FP%3E%3CP%3Eg%5BBorder%20Box(%201%20)%5D%20%26lt%3B%26lt%3B%20Top(%200%20)%3B%3C%2FP%3E%3CP%3Eg%5BBorder%20Box(%201%20)%5D%20%26lt%3B%26lt%3B%20bottom(%200%20)%3B%3C%2FP%3E%3CP%3Eg%5BBorder%20Box(%201%20)%5D%20%26lt%3B%26lt%3B%20sides(%200%20)%3B%20%2F%2F%20draw%20no%20sides%20(1%2B2%2B4%2B8%20would%20be%20all%20four%20sides)%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3Es%20%3D%20Slider%20Box(%200%2C%20.5%2C%20SliderValue%2C%20SliderFunction%20)%3B%20%2F%2F%20slider%20range%200%20to%20.5%3C%2FP%3E%3CP%3ESliderValue%20%3D%20.25%3B%20%2F%2F%20initial%20value%2C%20becomes%20current%20value%20when%20slider%20is%20moved%3C%2FP%3E%3CP%3ESliderFunction%20%3D%20Function(%20%7B%7D%2C%20g%5Bframe%20box(%201%20)%5D%20%26lt%3B%26lt%3B%20reshow%20)%3B%20%2F%2F%20reshow%20the%20graph%20when%20the%20slider%20moves%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%2F%2F%20put%20it%20all%20together%20in%20a%20window%3C%2FP%3E%3CP%3ENew%20Window(%20%22Example%22%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20Border%20Box(%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20Left(%2010%20)%2C%20Right(%2010%20)%2C%20top(%2010%20)%2C%20bottom(%2010%20)%2C%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20Lineup%20Box(%20N%20Col(%201%20)%2C%20g%2C%20s%20)%3C%2FP%3E%3CP%3E%20%20%20%20%20%20)%3C%2FP%3E%3CP%3E)%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CIMG%20width%3D%22146%22%20height%3D%22107%22%20style%3D%22border%3A%200px%3Bpadding-left%3A%205px%3Bpadding-right%3A%205px%22%20src%3D%22http%3A%2F%2Fblogs.sas.com%2Fjmp%2Fuploads%2Fimage015.gif%22%20alt%3D%22%22%20%2F%3E%3CIMG%20width%3D%22148%22%20height%3D%22106%22%20style%3D%22border%3A%200px%3Bpadding-left%3A%205px%3Bpadding-right%3A%205px%22%20src%3D%22http%3A%2F%2Fblogs.sas.com%2Fjmp%2Fuploads%2Fimage016.gif%22%20alt%3D%22%22%20%2F%3E%20%20%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FP%3E%3CP%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
Jeff_Perkinson
Community Manager Community Manager
Making Anonymous Graphs in JMP 8

How can I use JSL to make a graph with no labels on the axes? There are a lot of reasons you might want to do this; maybe you are building a dashboard control that shows a custom picture, or maybe you have data that needs no labels.


Anyway, there are two places to look to make the labels go away – the tick mark labels (0, 10, 20, … 100) and the axis label (a variable name like Height).


Let’s use the JSL Graph Box command to create the graph like this (taken directly from the Help->Indexes->JSL Functions->Graph Box description):



New Window( "Example",

Graph Box(

Frame Size( 300, 300 ),

xaxis(show major ticks(false),show minor ticks(false),show labels(false)),

yaxis(show major ticks(false),show minor ticks(false),show labels(false)),

Marker(

Marker State( 3 ),

[11 44 77],

[75 25 50]

);

Pen Color( "Blue" );

Line( [10 30 70], [88 22 44] );

)

);





To eliminate the tick mark labels, add two commands sent to the x and y axes:


New Window( "Example",

Graph Box(

Frame Size( 300, 300 ),

xaxis(show major ticks(false),show minor ticks(false),show labels(false)),

yaxis(show major ticks(false),show minor ticks(false),show labels(false)),

Marker(

Marker State( 3 ),

[11 44 77],

[75 25 50]

);

Pen Color( "Blue" );

Line( [10 30 70], [88 22 44] );

)

);





And to eliminate the axis labels, add two more commands sent to the axes:


New Window( "Example",

g = Graph Box(

Frame Size( 300, 300 ),

xaxis(show major ticks(false),show minor ticks(false),show labels(false)),

yaxis(show major ticks(false),show minor ticks(false),show labels(false)),

Marker(

Marker State( 3 ),

[11 44 77],

[75 25 50]

);

Pen Color( "Blue" );

Line( [10 30 70], [88 22 44] );

)

);

g[axis box(1)]<

g[axis box(2)] << remove axis label;

// you could remove the tick mark labels this way, especially if you are not using the Graph Box command

// g[framebox(1)] << xaxis(show major ticks(false),show minor ticks(false),show labels(false));

// g[framebox(1)] << yaxis(show major ticks(false),show minor ticks(false),show labels(false));





(Bonus) To remove the frame as well, send four commands to the frame:


New Window( "Example",

g = Graph Box(

Frame Size( 300, 300 ),

xaxis(show major ticks(false),show minor ticks(false),show labels(false)),

yaxis(show major ticks(false),show minor ticks(false),show labels(false)),

Marker(

Marker State( 3 ),

[11 44 77],

[75 25 50]

);

Pen Color( "Blue" );

Line( [10 30 70], [88 22 44] );

)

);

g[axis box(1)] << remove axis label;

g[axis box(2)] << remove axis label;

g[frame box(1)] << left(0);

g[frame box(1)] << right(0);

g[frame box(1)] << top(0);

g[frame box(1)] << bottom(0);





Here is a complete example with a slider to make it do something:


g = Graph Box(

Frame Size( 100, 20 ),

Pen Color( "Blue" );

Y Function( 50 + 50*Sin( x*SliderValue ), x ); // graph is a sin wave, period depends on SliderValue

);

// remove adornments from graph

g[framebox( 1 )] << xaxis( show major ticks( false ), show minor ticks( false ), show labels( false ) );

g[framebox( 1 )] << yaxis( show major ticks( false ), show minor ticks( false ), show labels( false ) );

g[axis box( 1 )] << remove axis label;

g[axis box( 2 )] << remove axis label;

// hide the inner border

g[frame box( 1 )] << Left( 0 ); // no line on left, etc

g[frame box( 1 )] << Right( 0 );

g[frame box( 1 )] << top( 0 );

g[frame box( 1 )] << bottom( 0 );

// shrink and hide the outer border too

g[Border Box( 1 )] << Left( 0 ); // no space on left, etc

g[Border Box( 1 )] << Right( 0 );

g[Border Box( 1 )] << Top( 0 );

g[Border Box( 1 )] << bottom( 0 );

g[Border Box( 1 )] << sides( 0 ); // draw no sides (1+2+4+8 would be all four sides)

s = Slider Box( 0, .5, SliderValue, SliderFunction ); // slider range 0 to .5

SliderValue = .25; // initial value, becomes current value when slider is moved

SliderFunction = Function( {}, g[frame box( 1 )] << reshow ); // reshow the graph when the slider moves

// put it all together in a window

New Window( "Example",

Border Box(

Left( 10 ), Right( 10 ), top( 10 ), bottom( 10 ),

Lineup Box( N Col( 1 ), g, s )

)

);


Article Labels

    There are no labels assigned to this post.

Article Tags