JavaFX running on Raspbian Stretch/Raspberry Pi Zero W 1.1 - javafx

My environment for run JavaFX application:
jdk1.8.0_144 by Oracle,
JavaFX Embedded SDK 8.60.9 (armv6 hard float) by Gluon,
Raspbian Stretch (last update 7.10.2017 - with sudo apt-get update/sudo apt-get dist-upgrade),
Raspberry Pi Zero W 1.1
Simple JavaFX Hello World aplication launch from NetBeans 8.2 (Remote Platform) and here is complete output in Output window from NetBeans 8.2 at launching:
Connecting to 192.168.1.14:22
cmd : cd '/home/pi/NetBeansProjects//JavaFXHelloWorldRPiApplication'; 'sudo' '/opt/jdk1.8.0_144/bin/java' -Dfile.encoding=UTF-8 -Djava.ext.dirs=/home/pi/armv6hf-sdk/rt/lib/ext -Dprism.verbose=true -Dprism.debug=true -Djavafx.verbose=true -Djavafx.debug=true -jar /home/pi/NetBeansProjects//JavaFXHelloWorldRPiApplication/dist/JavaFXHelloWorldRPiApplication.jar
Oct 07, 2017 4:18:13 PM com.sun.javafx.jmx.MXExtension initializeIfAvailable
INFO: Failed to initialize management extension
java.lang.ClassNotFoundException: com.oracle.javafx.jmx.MXExtensionImpl
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.sun.javafx.jmx.MXExtension.initializeIfAvailable(MXExtension.java:40)
at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:669)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:337)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Prism pipeline init order:
es2
sw
Using native-based Pisces rasterizer
Using dirty region optimizations
Using system sized mask for primitives
Not
f
orcing power of 2 sizes for textures
Using hardware CLAMP_TO_ZERO mode
Opting in for HiDPI pixel scaling
Prism pipeline name = com.sun.prism.es2.ES2Pipeline
Loading ES2 native library ... prism_es2_monocle
Loaded /home/pi/armv6hf-sdk/rt/lib/ext/../arm/libprism_es2_monocle.so from relative path
succeeded.
GLFactory using com.sun.prism.es2.MonocleGLFactory
Loaded /home/pi/armv6hf-sdk/rt/lib/ext/../arm/libglass_monocle.so from relative path
java.lang.UnsatisfiedLinkError: Error loading libGLESv2.so
at com.sun.glass.ui.monocle.AcceleratedScreen.initPlatformLibraries(AcceleratedScreen.java:158)
at com.sun.glass.ui.monocle.AcceleratedScreen.<init>(AcceleratedScreen.java:68)
at com.sun.glass.ui.monocle.DispmanAcceleratedScreen.<init>(DispmanAcceleratedScreen.java:34)
at com.sun.glass.ui.monocle.DispmanPlatform.getAcceleratedScreen(DispmanPlatform.java:43)
at com.sun.prism.es2.MonocleGLFactory.initialize(MonocleGLFactory.java:107)
at com.sun.prism.es2.ES2Pipeline.<clinit>(ES2Pipeline.java:82)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:187)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
at java.lang.Thread.run(Thread.java:748)
(X) Got class = class com.sun.prism.es2.ES2Pipeline
GraphicsPipeline.createPipeline: error initializing pipeline com.sun.prism.es2.ES2Pipeline
*** Fallback to Prism SW pipeline
Prism pipeline name = com.sun.prism.sw.SWPipeline
Loaded /home/pi/armv6hf-sdk/rt/lib/ext/../arm/libprism_sw.so from relative path
(X) Got class = class com.sun.prism.sw.SWPipeline
Initialized prism pipeline: com.sun.prism.sw.SWPipeline
JavaFX: using com.sun.javafx.tk.quantum.QuantumToolkit
Cannot open display
vsync: true vpipe: false
Launching application directly
Loaded /home/pi/armv6hf-sdk/rt/lib/ext/../arm/libjavafx_font.so from relative path
Loaded /home/pi/armv6hf-sdk/rt/lib/ext/../arm/libjavafx_font_freetype.so from relative path
Loaded /home/pi/armv6hf-sdk/rt/lib/ext/../arm/libjavafx_font_pango.so from relative path
Cannot create resource
PCS Texture allocating buffer: com.sun.prism.sw.SWRTTexture#2f2548, 1920x1080
+ PR.resetClip
+ concat scale com.sun.prism.sw.SWGraphics#1b521bb; sx: 1.0; sy: 1.0
+ PR.resetClip
+ PR.clear: Color[r=1.0, g=1.0, b=1.0, a=1.0]
PR.setColor: Color[r=1.0, g=1.0, b=1.0, a=1.0]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1b521bb; tr: Affine2D[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
+ concatTransform com.sun.prism.sw.SWGraphics#1b521bb; tr: Identity[]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1b521bb; tr: Affine2D[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
+ SWG.fillRect, x:
0.000000
, y:
0.000000
, w:
1920.000000
, h:
1080.000000
GR: com.sun.prism.sw.SWGraphics#1b521bb
target: com.sun.prism.sw.SWRTTexture#2f2548 t.w: 1920, t.h: 1080, t.dims: com.sun.javafx.geom.Rectangle[x=0,y=0,width=1920,height=1080]
Tx: Affine2D[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
Clip: com.sun.javafx.geom.Rectangle[x=0,y=0,width=1920,height=1080]
Composite rule: SRC_OVER
PR.setColor: Color[r=0.9569631, g=0.9569631, b=0.9569631, a=1.0]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1b521bb; tr: Affine2D[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
+ concatTransform com.sun.prism.sw.SWGraphics#1b521bb; tr: Translate2D[10.0, 10.0]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1b521bb; tr: Affine2D[[1.0, 0.0, 10.0], [0.0, 1.0, 10.0]]
+ SWG.fillRoundRect
PR.setColor: Color[r=0.6784314, g=0.84705883, b=0.9019608, a=1.0]
GR: com.sun.prism.sw.SWGraphics#1b521bb
target: com.sun.prism.sw.SWRTTexture#2f2548 t.w: 1920, t.h: 1080, t.dims: com.sun.javafx.geom.Rectangle[x=0,y=0,width=1920,height=1080]
Shape: com.sun.javafx.geom.RoundRectangle2D[x=0.0,y=0.0,w=1900.0,h=1060.0]
Stroke: null
Tx: Affine2D[[1.0, 0.0, 10.0], [0.0, 1.0, 10.0]]
Clip: com.sun.javafx.geom.Rectangle[x=0,y=0,width=1920,height=1080]
Composite rule: SRC_OVER
Loading Prism common native library ...
Loaded /home/pi/armv6hf-sdk/rt/lib/ext/../arm/libprism_common.so from relative path
succeeded.
MASK TEXTURE, Pixel format: BYTE_ALPHA, buffer: java.nio.HeapByteBuffer[pos=0 lim=2076672 cap=2076672]
dstx:0 dsty:0
srcx:0 srcy:0 srcw:1900 srch:1060 srcscan: 1900
PCS Texture allocating buffer: com.sun.prism.sw.SWMaskTexture#1697604, 1900x1060
+ restoreTransform com.sun.prism.sw.SWGraphics#1b521bb; tr: Affine2D[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1b521bb; tr: Affine2D[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
+ concatTransform com.sun.prism.sw.SWGraphics#1b521bb; tr: Translate2D[883.0, 525.0]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1b521bb; tr: Affine2D[[1.0, 0.0, 883.0], [0.0, 1.0, 525.0]]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1b521bb; tr: Affine2D[[1.0, 0.0, 883.0], [0.0, 1.0, 525.0]]
PCS Texture allocating buffer: com.sun.prism.sw.SWRTTexture#fceee5, 2048x1024
+ PR.resetClip
+ concat translate com.sun.prism.sw.SWGraphics#1baa41; tx: 3.0; ty: 3.0
+ SWG.fillRoundRect
PR.setColor: Color[r=0.011764706, g=0.61960787, b=0.827451, a=1.0]
GR: com.sun.prism.sw.SWGraphics#1baa41
target: com.sun.prism.sw.SWRTTexture#fceee5 t.w: 2048, t.h: 1024, t.dims: com.sun.javafx.geom.Rectangle[x=0,y=0,width=2048,height=1024]
Shape: com.sun.javafx.geom.RoundRectangle2D[x=-0.2,y=-0.2,w=10.4,h=31.400002]
Stroke: null
Tx: Affine2D[[1.0, 0.0, 3.0], [0.0, 1.0, 3.0]]
Clip: com.sun.javafx.geom.Rectangle[x=0,y=0,width=2048,height=1024]
Composite rule: SRC_OVER
MASK TEXTURE, Pixel format: BYTE_ALPHA, buffer: java.nio.HeapByteBuffer[pos=0 lim=2097152 cap=2097152]
dstx:0 dsty:0
srcx:0 srcy:0 srcw:12 srch:33 srcscan: 12
+ SWG.fillRoundRect
PR.setLinearGradient: 0.0, 0.0, 0.0, 1.0
GR: com.sun.prism.sw.SWGraphics#1baa41
target: com.sun.prism.sw.SWRTTexture#fceee5 t.w: 2048, t.h: 1024, t.dims: com.sun.javafx.geom.Rectangle[x=0,y=0,width=2048,height=1024]
Shape: com.sun.javafx.geom.RoundRectangle2D[x=1.0,y=1.0,w=8.0,h=29.0]
Stroke: null
Tx: Affine2D[[1.0, 0.0, 3.0], [0.0, 1.0, 3.0]]
Clip: com.sun.javafx.geom.Rectangle[x=0,y=0,width=2048,height=1024]
Composite rule: SRC_OVER
MASK TEXTURE, Pixel format: BYTE_ALPHA, buffer: java.nio.HeapByteBuffer[pos=396 lim=2097152 cap=2097152]
dstx:0 dsty:0
srcx:0 srcy:0 srcw:8 srch:29 srcscan: 8
+ SWG.fillRoundRect
PR.setLinearGradient: 0.0, 0.0, 0.0, 1.0
GR: com.sun.prism.sw.SWGraphics#1baa41
target: com.sun.prism.sw.SWRTTexture#fceee5 t.w: 2048, t.h: 1024, t.dims: com.sun.javafx.geom.Rectangle[x=0,y=0,width=2048,height=1024]
Shape: com.sun.javafx.geom.RoundRectangle2D[x=2.0,y=2.0,w=6.0,h=27.0]
Stroke: null
Tx: Affine2D[[1.0, 0.0, 3.0], [0.0, 1.0, 3.0]]
Clip: com.sun.javafx.geom.Rectangle[x=0,y=0,width=2048,height=1024]
Composite rule: SRC_OVER
MASK TEXTURE, Pixel format: BYTE_ALPHA, buffer: java.nio.HeapByteBuffer[pos=232 lim=2097152 cap=2097152]
dstx:0 dsty:0
srcx:0 srcy:0 srcw:6 srch:27 srcscan: 6
+ SWG.fillRoundRect
PR.setColor: Color[r=0.011764706, g=0.61960787, b=0.827451, a=0.13333334]
GR: com.sun.prism.sw.SWGraphics#1baa41
target: com.sun.prism.sw.SWRTTexture#fceee5 t.w: 2048, t.h: 1024, t.dims: com.sun.javafx.geom.Rectangle[x=0,y=0,width=2048,height=1024]
Shape: com.sun.javafx.geom.RoundRectangle2D[x=-1.4,y=-1.4,w=12.799999,h=33.800003]
Stroke: null
Tx: Affine2D[[1.0, 0.0, 3.0], [0.0, 1.0, 3.0]]
Clip: com.sun.javafx.geom.Rectangle[x=0,y=0,width=2048,height=1024]
Composite rule: SRC_OVER
MASK TEXTURE, Pixel format: BYTE_ALPHA, buffer: java.nio.HeapByteBuffer[pos=162 lim=2097152 cap=2097152]
dstx:0 dsty:0
srcx:0 srcy:0 srcw:14 srch:35 srcscan: 14
PCS Texture allocating buffer: com.sun.prism.sw.SWMaskTexture#11bd84c, 14x35
+ SWG.fillRoundRect
PR.setLinearGradient: 0.0, 0.0, 0.0, 1.0
GR: com.sun.prism.sw.SWGraphics#1baa41
target: com.sun.prism.sw.SWRTTexture#fceee5 t.w: 2048, t.h: 1024, t.dims: com.sun.javafx.geom.Rectangle[x=0,y=0,width=2048,height=1024]
Shape: com.sun.javafx.geom.RoundRectangle2D[x=2.6,y=2.6,w=4.8,h=25.8]
Stroke: null
Tx: Affine2D[[1.0, 0.0, 3.0], [0.0, 1.0, 3.0]]
Clip: com.sun.javafx.geom.Rectangle[x=0,y=0,width=2048,height=1024]
Composite rule: SRC_OVER
MASK TEXTURE, Pixel format: BYTE_ALPHA, buffer: java.nio.HeapByteBuffer[pos=490 lim=2097152 cap=2097152]
dstx:0 dsty:0
srcx:0 srcy:0 srcw:6 srch:27 srcscan: 6
+ drawTexture: com.sun.prism.sw.SWRTTexture#fceee5, imageMode: 1, tex.w: 2048, tex.h: 1024, tex.cw: 2048, tex.ch: 1024
target: com.sun.prism.sw.SWRTTexture#2f2548 t.w: 1920, t.h: 1080, t.dims: com.sun.javafx.geom.Rectangle[x=0,y=0,width=1920,height=1080]
GR: com.sun.prism.sw.SWGraphics#1b521bb
dx1:-2.4960938 dy1:-2.4960938 dx2:5.0 dy2:33.496094
sx1:0.50390625 sy1:0.50390625 sx2:8.0 sy2:36.496094
Clip: com.sun.javafx.geom.Rectangle[x=0,y=0,width=1920,height=1080]
Composite rule: SRC_OVER
tx: Affine2D[[1.0, 0.0, 883.0], [0.0, 1.0, 525.0]]
piscesTx: Transform6[m00=1.0, m01=0.0, m02=880.0, m10=0.0, m11=1.0, m12=522.0]
srcBBox: RectBounds { minX:-2.4960938, minY:-2.4960938, maxX:5.0, maxY:33.496094} (w:7.4960938, h:35.992188)
dstBBox: RectBounds { minX:880.5039, minY:522.5039, maxX:888.0, maxY:558.4961} (w:7.4960938, h:35.992188)
* drawTexture, DONE
+ drawTexture: com.sun.prism.sw.SWRTTexture#fceee5, imageMode: 1, tex.w: 2048, tex.h: 1024, tex.cw: 2048, tex.ch: 1024
target: com.sun.prism.sw.SWRTTexture#2f2548 t.w: 1920, t.h: 1080, t.dims: com.sun.javafx.geom.Rectangle[x=0,y=0,width=1920,height=1080]
GR: com.sun.prism.sw.SWGraphics#1b521bb
dx1:5.0 dy1:-2.4960938 dx2:150.0 dy2:33.496094
sx1:8.0 sy1:0.50390625 sx2:8.0 sy2:36.496094
Clip: com.sun.javafx.geom.Rectangle[x=0,y=0,width=1920,height=1080]
Composite rule: SRC_OVER
tx: Affine2D[[1.0, 0.0, 883.0], [0.0, 1.0, 525.0]]
piscesTx: Transform6[m00=32767.0, m01=0.0, m02=-32768.0, m10=0.0, m11=1.0, m12=522.0]
srcBBox: RectBounds { minX:5.0, minY:-2.4960938, maxX:150.0, maxY:33.496094} (w:145.0, h:35.992188)
dstBBox: RectBounds { minX:888.0, minY:522.5039, maxX:1033.0, maxY:558.4961} (w:145.0, h:35.992188)
* drawTexture, DONE
+ drawTexture: com.sun.prism.sw.SWRTTexture#fceee5, imageMode: 1, tex.w: 2048, tex.h: 1024, tex.cw: 2048, tex.ch: 1024
target: com.sun.prism.sw.SWRTTexture#2f2548 t.w: 1920, t.h: 1080, t.dims: com.sun.javafx.geom.Rectangle[x=0,y=0,width=1920,height=1080]
GR: com.sun.prism.sw.SWGraphics#1b521bb
dx1:150.0 dy1:-2.4960938 dx2:157.4961 dy2:33.496094
sx1:8.0 sy1:0.50390625 sx2:15.496094 sy2:36.496094
Clip: com.sun.javafx.geom.Rectangle[x=0,y=0,width=1920,height=1080]
Composite rule: SRC_OVER
tx: Affine2D[[1.0, 0.0, 883.0], [0.0, 1.0, 525.0]]
piscesTx: Transform6[m00=1.0, m01=0.0, m02=1025.0, m10=0.0, m11=1.0, m12=522.0]
srcBBox: RectBounds { minX:150.0, minY:-2.4960938, maxX:157.4961, maxY:33.496094} (w:7.4960938, h:35.992188)
dstBBox: RectBounds { minX:1033.0, minY:522.5039, maxX:1040.4961, maxY:558.4961} (w:7.4960938, h:35.992188)
* drawTexture, DONE
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1b521bb; tr: Affine2D[[1.0, 0.0, 883.0], [0.0, 1.0, 525.0]]
+ concatTransform com.sun.prism.sw.SWGraphics#1b521bb; tr: Translate2D[11.0, 21.0]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1b521bb; tr: Affine2D[[1.0, 0.0, 894.0], [0.0, 1.0, 546.0]]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1b521bb; tr: Affine2D[[1.0, 0.0, 894.0], [0.0, 1.0, 546.0]]
+ SWG.drawGlyphList, gl.Count: 17, x: 0.0, y: 0.0, selectStart: -1, selectEnd: -1
PR.setColor: Color[r=0.2, g=0.2, b=0.2, a=1.0]
+ SWG.setNodeBounds: null
+ restoreTransform com.sun.prism.sw.SWGraphics#1b521bb; tr: Affine2D[[1.0, 0.0, 883.0], [0.0, 1.0, 525.0]]
+ restoreTransform com.sun.prism.sw.SWGraphics#1b521bb; tr: Affine2D[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1b521bb; tr: Affine2D[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
+ concatTransform com.sun.prism.sw.SWGraphics#1b521bb; tr: Translate2D[903.0, 561.0]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1b521bb; tr: Affine2D[[1.0, 0.0, 903.0], [0.0, 1.0, 561.0]]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1b521bb; tr: Affine2D[[1.0, 0.0, 903.0], [0.0, 1.0, 561.0]]
+ concatTransform com.sun.prism.sw.SWGraphics#1b521bb; tr: Translate2D[0.0, 15.0]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1b521bb; tr: Affine2D[[1.0, 0.0, 903.0], [0.0, 1.0, 576.0]]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1b521bb; tr: Affine2D[[1.0, 0.0, 903.0], [0.0, 1.0, 576.0]]
+ SWG.drawGlyphList, gl.Count: 17, x: 0.0, y: 0.0, selectStart: -1, selectEnd: -1
PR.setColor: Color[r=0.2, g=0.2, b=0.2, a=1.0]
+ SWG.setNodeBounds: null
+ restoreTransform com.sun.prism.sw.SWGraphics#1b521bb; tr: Affine2D[[1.0, 0.0, 903.0], [0.0, 1.0, 561.0]]
+ restoreTransform com.sun.prism.sw.SWGraphics#1b521bb; tr: Affine2D[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
+ restoreTransform com.sun.prism.sw.SWGraphics#1b521bb; tr: Affine2D[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
+ PR.resetClip
+ concat scale com.sun.prism.sw.SWGraphics#1d98f9a; sx: 1.0; sy: 1.0
+ PR.resetClip
+ PR.clear: Color[r=1.0, g=1.0, b=1.0, a=1.0]
PR.setColor: Color[r=1.0, g=1.0, b=1.0, a=1.0]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1d98f9a; tr: Affine2D[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
+ concatTransform com.sun.prism.sw.SWGraphics#1d98f9a; tr: Identity[]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1d98f9a; tr: Affine2D[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
+ SWG.fillRect, x:
0.000000
, y:
0.000000
, w:
1920.000000
, h:
1080.000000
GR: com.sun.prism.sw.SWGraphics#1d98f9a
target: com.sun.prism.sw.SWRTTexture#2f2548 t.w: 1920, t.h: 1080, t.dims: com.sun.javafx.geom.Rectangle[x=0,y=0,width=1920,height=1080]
Tx: Affine2D[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
Clip: com.sun.javafx.geom.Rectangle[x=0,y=0,width=1920,height=1080]
Composite rule: SRC_OVER
PR.setColor: Color[r=0.9569631, g=0.9569631, b=0.9569631, a=1.0]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1d98f9a; tr: Affine2D[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
+ concatTransform com.sun.prism.sw.SWGraphics#1d98f9a; tr: Translate2D[10.0, 10.0]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1d98f9a; tr: Affine2D[[1.0, 0.0, 10.0], [0.0, 1.0, 10.0]]
+ SWG.fillRoundRect
PR.setColor: Color[r=0.6784314, g=0.84705883, b=0.9019608, a=1.0]
GR: com.sun.prism.sw.SWGraphics#1d98f9a
target: com.sun.prism.sw.SWRTTexture#2f2548 t.w: 1920, t.h: 1080, t.dims: com.sun.javafx.geom.Rectangle[x=0,y=0,width=1920,height=1080]
Shape: com.sun.javafx.geom.RoundRectangle2D[x=0.0,y=0.0,w=1900.0,h=1060.0]
Stroke: null
Tx: Affine2D[[1.0, 0.0, 10.0], [0.0, 1.0, 10.0]]
Clip: com.sun.javafx.geom.Rectangle[x=0,y=0,width=1920,height=1080]
Composite rule: SRC_OVER
MASK TEXTURE, Pixel format: BYTE_ALPHA, buffer: java.nio.HeapByteBuffer[pos=162 lim=2097152 cap=2097152]
dstx:0 dsty:0
srcx:0 srcy:0 srcw:1900 srch:1060 srcscan: 1900
PCS Texture allocating buffer: com.sun.prism.sw.SWMaskTexture#1856384, 1900x1060
+ restoreTransform com.sun.prism.sw.SWGraphics#1d98f9a; tr: Affine2D[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1d98f9a; tr: Affine2D[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
+ concatTransform com.sun.prism.sw.SWGraphics#1d98f9a; tr: Translate2D[883.0, 525.0]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1d98f9a; tr: Affine2D[[1.0, 0.0, 883.0], [0.0, 1.0, 525.0]]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1d98f9a; tr: Affine2D[[1.0, 0.0, 883.0], [0.0, 1.0, 525.0]]
+ drawTexture: com.sun.prism.sw.SWRTTexture#fceee5, imageMode: 1, tex.w: 2048, tex.h: 1024, tex.cw: 2048, tex.ch: 1024
target: com.sun.prism.sw.SWRTTexture#2f2548 t.w: 1920, t.h: 1080, t.dims: com.sun.javafx.geom.Rectangle[x=0,y=0,width=1920,height=1080]
GR: com.sun.prism.sw.SWGraphics#1d98f9a
dx1:-2.4960938 dy1:-2.4960938 dx2:5.0 dy2:33.496094
sx1:0.50390625 sy1:0.50390625 sx2:8.0 sy2:36.496094
Clip: com.sun.javafx.geom.Rectangle[x=0,y=0,width=1920,height=1080]
Composite rule: SRC_OVER
tx: Affine2D[[1.0, 0.0, 883.0], [0.0, 1.0, 525.0]]
piscesTx: Transform6[m00=1.0, m01=0.0, m02=880.0, m10=0.0, m11=1.0, m12=522.0]
srcBBox: RectBounds { minX:-2.4960938, minY:-2.4960938, maxX:5.0, maxY:33.496094} (w:7.4960938, h:35.992188)
dstBBox: RectBounds { minX:880.5039, minY:522.5039, maxX:888.0, maxY:558.4961} (w:7.4960938, h:35.992188)
* drawTexture, DONE
+ drawTexture: com.sun.prism.sw.SWRTTexture#fceee5, imageMode: 1, tex.w: 2048, tex.h: 1024, tex.cw: 2048, tex.ch: 1024
target: com.sun.prism.sw.SWRTTexture#2f2548 t.w: 1920, t.h: 1080, t.dims: com.sun.javafx.geom.Rectangle[x=0,y=0,width=1920,height=1080]
GR: com.sun.prism.sw.SWGraphics#1d98f9a
dx1:5.0 dy1:-2.4960938 dx2:150.0 dy2:33.496094
sx1:8.0 sy1:0.50390625 sx2:8.0 sy2:36.496094
Clip: com.sun.javafx.geom.Rectangle[x=0,y=0,width=1920,height=1080]
Composite rule: SRC_OVER
tx: Affine2D[[1.0, 0.0, 883.0], [0.0, 1.0, 525.0]]
piscesTx: Transform6[m00=32767.0, m01=0.0, m02=-32768.0, m10=0.0, m11=1.0, m12=522.0]
srcBBox: RectBounds { minX:5.0, minY:-2.4960938, maxX:150.0, maxY:33.496094} (w:145.0, h:35.992188)
dstBBox: RectBounds { minX:888.0, minY:522.5039, maxX:1033.0, maxY:558.4961} (w:145.0, h:35.992188)
* drawTexture, DONE
+ drawTexture: com.sun.prism.sw.SWRTTexture#fceee5, imageMode: 1, tex.w: 2048, tex.h: 1024, tex.cw: 2048, tex.ch: 1024
target: com.sun.prism.sw.SWRTTexture#2f2548 t.w: 1920, t.h: 1080, t.dims: com.sun.javafx.geom.Rectangle[x=0,y=0,width=1920,height=1080]
GR: com.sun.prism.sw.SWGraphics#1d98f9a
dx1:150.0 dy1:-2.4960938 dx2:157.4961 dy2:33.496094
sx1:8.0 sy1:0.50390625 sx2:15.496094 sy2:36.496094
Clip: com.sun.javafx.geom.Rectangle[x=0,y=0,width=1920,height=1080]
Composite rule: SRC_OVER
tx: Affine2D[[1.0, 0.0, 883.0], [0.0, 1.0, 525.0]]
piscesTx: Transform6[m00=1.0, m01=0.0, m02=1025.0, m10=0.0, m11=1.0, m12=522.0]
srcBBox: RectBounds { minX:150.0, minY:-2.4960938, maxX:157.4961, maxY:33.496094} (w:7.4960938, h:35.992188)
dstBBox: RectBounds { minX:1033.0, minY:522.5039, maxX:1040.4961, maxY:558.4961} (w:7.4960938, h:35.992188)
* drawTexture, DONE
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1d98f9a; tr: Affine2D[[1.0, 0.0, 883.0], [0.0, 1.0, 525.0]]
+ concatTransform com.sun.prism.sw.SWGraphics#1d98f9a; tr: Translate2D[11.0, 21.0]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1d98f9a; tr: Affine2D[[1.0, 0.0, 894.0], [0.0, 1.0, 546.0]]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1d98f9a; tr: Affine2D[[1.0, 0.0, 894.0], [0.0, 1.0, 546.0]]
+ SWG.drawGlyphList, gl.Count: 17, x: 0.0, y: 0.0, selectStart: -1, selectEnd: -1
PR.setColor: Color[r=0.2, g=0.2, b=0.2, a=1.0]
+ SWG.setNodeBounds: null
+ restoreTransform com.sun.prism.sw.SWGraphics#1d98f9a; tr: Affine2D[[1.0, 0.0, 883.0], [0.0, 1.0, 525.0]]
+ restoreTransform com.sun.prism.sw.SWGraphics#1d98f9a; tr: Affine2D[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1d98f9a; tr: Affine2D[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
+ concatTransform com.sun.prism.sw.SWGraphics#1d98f9a; tr: Translate2D[903.0, 561.0]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1d98f9a; tr: Affine2D[[1.0, 0.0, 903.0], [0.0, 1.0, 561.0]]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1d98f9a; tr: Affine2D[[1.0, 0.0, 903.0], [0.0, 1.0, 561.0]]
+ concatTransform com.sun.prism.sw.SWGraphics#1d98f9a; tr: Translate2D[0.0, 15.0]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1d98f9a; tr: Affine2D[[1.0, 0.0, 903.0], [0.0, 1.0, 576.0]]
+ getTransformNoClone com.sun.prism.sw.SWGraphics#1d98f9a; tr: Affine2D[[1.0, 0.0, 903.0], [0.0, 1.0, 576.0]]
+ SWG.drawGlyphList, gl.Count: 17, x: 0.0, y: 0.0, selectStart: -1, selectEnd: -1
PR.setColor: Color[r=0.2, g=0.2, b=0.2, a=1.0]
+ SWG.setNodeBounds: null
+ restoreTransform com.sun.prism.sw.SWGraphics#1d98f9a; tr: Affine2D[[1.0, 0.0, 903.0], [0.0, 1.0, 561.0]]
+ restoreTransform com.sun.prism.sw.SWGraphics#1d98f9a; tr: Affine2D[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
+ restoreTransform com.sun.prism.sw.SWGraphics#1d98f9a; tr: Affine2D[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
BUILD STOPPED (total time: 2 minutes 0 seconds)
Important is this:
GLFactory using com.sun.prism.es2.MonocleGLFactory
Loaded /home/pi/armv6hf-sdk/rt/lib/ext/../arm/libglass_monocle.so from relative path
**java.lang.UnsatisfiedLinkError: Error loading libGLESv2.so**
at com.sun.glass.ui.monocle.AcceleratedScreen.initPlatformLibraries(AcceleratedScreen.java:158)
at com.sun.glass.ui.monocle.AcceleratedScreen.<init>(AcceleratedScreen.java:68)
at com.sun.glass.ui.monocle.DispmanAcceleratedScreen.<init>(DispmanAcceleratedScreen.java:34)
at com.sun.glass.ui.monocle.DispmanPlatform.getAcceleratedScreen(DispmanPlatform.java:43)
at com.sun.prism.es2.MonocleGLFactory.initialize(MonocleGLFactory.java:107)
at com.sun.prism.es2.ES2Pipeline.<clinit>(ES2Pipeline.java:82)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:187)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
at java.lang.Thread.run(Thread.java:748)
(X) Got class = class com.sun.prism.es2.ES2Pipeline
GraphicsPipeline.createPipeline: error initializing pipeline com.sun.prism.es2.ES2Pipeline
*** Fallback to Prism SW pipeline
Prism pipeline name = com.sun.prism.sw.SWPipeline
Loaded /home/pi/armv6hf-sdk/rt/lib/ext/../arm/libprism_sw.so from relative path
(X) Got class = class com.sun.prism.sw.SWPipeline
**Initialized prism pipeline: com.sun.prism.sw.SWPipeline**
JavaFX: using com.sun.javafx.tk.quantum.QuantumToolkit
Cannot open display
libGLESv2.so - https://github.com/RPi-Distro/firmware/issues/3
Used is Prism SW pipeline, but no ES2 pipeline (hw accelerated).
SW pipeline is broken (mouse cursor in not visible, etc.).
Obviously a fix is needed in JavaFX Embedded SDK.

For more relevant informations see this:
https://www.raspberrypi.org/forums/viewtopic.php?f=81&t=195026#p1221399

I am today cross building JavaFX for armv6hf platform on 32-bit Ubuntu 16.04.3 with modifications listed on https://www.raspberrypi.org/forums/viewtopic.php?f=81&t=195026#p1221481 and all is perfect works (yet simple HelloWorld application with one button).

Related

Question regarding some specific labelling on plots

I have a code for a plot that I am trying to add specific labels for.
The data code is this:
CombinedMetricScore<-c("zero", "5", "10", "15", "20", "25", "30", "35", "40",
"45", "50", "60", "M11", "MICKEY", "MEANING", "MICKEYTWO",
"MICKEYTHREE", "MIKE", "PASTA", "MCIDandPASS",
"MICKDorPASS", "MIKEDOORPASS", "WOMAC20andPASS" ,"Ideal")
FalsePositiveRate<-c( 0, 0.05, 0.08, 0.12, 0.2, 0.28, 0.19, 0.5, 0.6, 0.7, 0.8, 0.94,
0.11, 0.28, 0.07, 0.5, 0.08, 0.28, 0.04, 0.3, 0.03, 0.03, 0.22, 1 )
TruePositiveRate<-c(0, 0.31, 0.35, 0.46, 0.69, 0.73, 0.59, 0.92, 0.92, 0.96, 1, 1,
0.46, 0.73, 0.42, 0.88, 0.35, 0.73, 0.46, 0.73, 0.46, 0.46, 0.69, 1)
ScoreOrMetric<-c("Metric", "Score", "Score", "Score", "Score", "Score", "Score", "Score", "Score",
"Score", "Score", "Score", "Metric", "Metric", "Metric", "Metric",
"Metric", "Metric", "Metric", "Metric",
"Metric", "Score", "Score", "Metric" )
COMBINEDSCORETABLE<-data.frame(CombinedMetricScore, FalsePositiveRate, TruePositiveRate, ScoreOrMetric)
The plot code is this:
ggplot(COMBINEDSCORETABLE, aes(x = FalsePositiveRate, y = TruePositiveRate, color = ScoreOrMetric)) +
geom_abline(slope = 1, intercept = .5, lwd = 1.5, color = "grey") +
geom_point(size =2, alpha = .8) +
coord_cartesian(xlim=c(0,1), ylim=c(0, 1)) +
coord_fixed() +
geom_text_repel(label = ifelse(TruePositiveRate > .44 + FalsePositiveRate,
yes = CombinedMetricScore, no = ""),
box.padding = 0.5)
Question: I want to add labels for the following 2 points "5", "45" but I don't know how to add it to my existing plot code.
We can use an | ("OR") in your ifelse logic. In general, though, I recommend only passing the data you need to geom_text_repel instead of everything (most of which having ""), so try this:
ggplot(COMBINEDSCORETABLE, aes(x = FalsePositiveRate, y = TruePositiveRate, color = ScoreOrMetric)) +
geom_abline(slope = 1, intercept = .5, lwd = 1.5, color = "grey") +
geom_point(size =2, alpha = .8) +
coord_cartesian(xlim=c(0,1), ylim=c(0, 1)) +
coord_fixed() +
ggrepel::geom_text_repel(
aes(label = CombinedMetricScore),
box.padding = 0.5,
data = ~ subset(., TruePositiveRate > (0.44 + FalsePositiveRate) | CombinedMetricScore %in% c("5", "45")))

change linetype in legend for geom_vline()

I want to do a graph where I use 4 geom_vlines with differents linetypes, but in the legend the linetype isn't right. How can I make the linetype of the legend fits with the linetype of the vline?
ps: I have abbreviate the dataframe because it's too big
I had to use show.legend = FALSE, otherwise the legend becames like the second image
And I tried to use scale_linetype_manual(), but it doesn't work.
thank you very much for helping me!!
library("ggplot2")
Data<-c('2021-1-10','2021-1-11','2021-1-11','2021-1-12','2021-1-12','2021-1-13','2021-1-13','2021-1-14',
'2021-1-14','2021-1-15','2021-1-15','2021-1-16','2021-1-17','2021-1-17','2021-1-18',
'2021-1-19','2021-1-19','2021-1-20','2021-1-20','2021-1-21','2021-1-21','2021-1-22',
'2021-1-23','2021-1-23','2021-1-24','2021-1-25','2021-1-25','2021-1-26','2021-1-26',
'2021-1-27','2021-1-27','2021-1-28','2021-1-29','2021-1-30','2021-1-31','2021-1-31',
'2021-2-1','2021-2-1','2021-2-2','2021-2-2','2021-2-3','2021-2-3','2021-2-4','2021-2-4',
'2021-2-5','2021-2-6','2021-2-6','2021-2-7','2021-2-7','2021-2-8','2021-2-10',
'2021-2-11','2021-2-11','2021-2-12')
Acumulado_CP_positivo<-c(0.417, 0.427, 0.427, 0.438, 0.438, 0.508, 0.508, 0.628, 0.628, 0.663, 0.663, 0.663, 0.693, 0.693, 0.705, 0.727, 0.727, 0.727, 0.727, 0.729, 0.729, 0.747, 0.747, 0.793, 0.793, 1.018, 1.018, 1.031, 1.031, 1.031, 1.031, 1.035, 1.107, 1.107, 1.107, 1.107, 1.148, 1.15, 1.162, 1.162, 1.162, 1.162, 1.194, 1.209, 1.209, 1.209, 1.209, 1.209, 1.209, 1.281, 1.281, 1.284, 1.284, 1.284)
Data<-as.Date(Data, format="%Y-%m-%d", origin = "2021-1-10")
df<-data.frame(Data, Acumulado_CP_positivo)
ggplot(df, aes(x = Data, y = Acumulado_CP_positivo))+
geom_line(lwd = 0.8, aes(colour="Afluência"))+
geom_vline(aes(colour="\nVazão Operativa \nVertedouro",
xintercept=as.Date("2021-01-21")),
linetype=2,
lwd = 0.75,
show.legend=FALSE)+
geom_vline(aes(colour="\nVazão Operativa \nSDT",
xintercept=as.Date("2021-01-12")),
linetype=2,
lwd = 0.75,
show.legend=FALSE)+
geom_vline(aes(colour="1° Rompimento LBMD",
xintercept=as.Date("2021-01-28")),
linetype=3,
lwd = 0.75,
show.legend=FALSE)+
geom_vline(aes(colour="2° Rompimento LBMD",
xintercept=as.Date("2021-02-08")),
linetype=3,
lwd = 0.75,
show.legend=FALSE)+
scale_color_brewer(palette="Dark2")+
scale_y_continuous(breaks = c(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20))+
theme_bw()+
labs(title = "Variação Diária Acumulada (ha)",
subtitle = "Vertedouro - MD", x = "Data", y = "Área Acumulada (ha)")+
theme(legend.title = element_blank())
the linetype of the legend doesn't fits with the linetype of the graphic
this is how the graph stays when I write show.legend=TRUE

ggplot: scale second axis with error bars

I am attempting to graph two scatter plots with associated error bars using ggplot2. I would like the top of left axis to be ~0 and range down to -2000 and for the bottom of the right axis to be 0 and range up to about 0.15.
I can re-scale the axes for the points themselves following the instructions here but I am having trouble generalizing the instructions to include error bars.
Here is my current plot
Here is my code
library(tidyverse)
library(ggplot2)
deciles <- data.frame(count = 1:10,
coef_maroon = c(0.005, 0.015, 0.015, 0.02, 0.03, 0.07, 0.09, 0.12, 0.12, 0.13),
ci_upper_maroon = c(0.008, 0.02, 0.025, 0.03, 0.04, 0.09, 0.11, 0.14, 0.13, 0.15),
ci_lower_maroon = c(0.001, 0.01, 0.005, 0, 0.01, 0.05, 0.07, 0.11, 0.11, 0.12),
coef_navy= c(0, -200, -400, -600, -800, -700, -900, -900, -1100, -1700),
ci_upper_navy = c(100, -100, -300, -500, -700, -600, -800, -700, -900, -1600),
ci_lower_navy = c(-100, -500, -700, -900, -850, -800, -950, -1000, -1200, -1900))
scl = with(deciles, max(abs(coef_navy))/max(abs(coef_maroon)))
ggplot(deciles) +
geom_point(aes(x = count, y = coef_navy, color = 'navy')) +
geom_point(aes(x = count, y = coef_maroon*scl-1200, color = 'maroon')) +
geom_errorbar(aes(x = count, ymin = ci_lower_navy, ymax = ci_upper_navy, color = 'navy'), width = 0) +
geom_errorbar(aes(x = count, ymin = ci_lower_maroon*scl-1200, ymax = ci_upper_maroon*scl-1200, color = 'maroon', width = 0)) +
labs(x = "Group", y = "") +
scale_color_manual(values = c('maroon', 'navy')) +
scale_y_continuous(sec.axis = sec_axis(~(.+1200)/scl, name = "2nd axis"))
My question is how can I scale my axes such that the downward trending plot (left axis) "starts" in the top left corner and the upward trending plot (right axis) starts in the bottom left?
As you can see, there is much dead space in the top of the left axis and the right axis need not range as low as -0.05 because the smallest maroon value is just above 0.
Thank you
Does adjusting the scaling factor (1200 to 1900) work for you?
library(tidyverse)
deciles <- data.frame(count = 1:10,
coef_maroon = c(0.005, 0.015, 0.015, 0.02, 0.03, 0.07, 0.09, 0.12, 0.12, 0.13),
ci_upper_maroon = c(0.008, 0.02, 0.025, 0.03, 0.04, 0.09, 0.11, 0.14, 0.13, 0.15),
ci_lower_maroon = c(0.001, 0.01, 0.005, 0, 0.01, 0.05, 0.07, 0.11, 0.11, 0.12),
coef_navy= c(0, -200, -400, -600, -800, -700, -900, -900, -1100, -1700),
ci_upper_navy = c(100, -100, -300, -500, -700, -600, -800, -700, -900, -1600),
ci_lower_navy = c(-100, -500, -700, -900, -850, -800, -950, -1000, -1200, -1900))
scl = with(deciles, max(abs(coef_navy))/max(abs(coef_maroon)))
ggplot(deciles) +
geom_point(aes(x = count, y = coef_navy, color = 'navy')) +
geom_point(aes(x = count, y = coef_maroon*scl-1900, color = 'maroon')) +
geom_errorbar(aes(x = count, ymin = ci_lower_navy, ymax = ci_upper_navy, color = 'navy'), width = 0) +
geom_errorbar(aes(x = count, ymin = ci_lower_maroon*scl-1900, ymax = ci_upper_maroon*scl-1900, color = 'maroon', width = 0)) +
labs(x = "Group", y = "") +
scale_color_manual(values = c('maroon', 'navy')) +
scale_y_continuous(sec.axis = sec_axis(~(.+1900)/scl, name = "2nd axis"))
Created on 2021-09-02 by the reprex package (v2.0.1)
Also, depending on how relevant the x-axis values are, you could consider nudging the values so they don't overlap, e.g.
library(tidyverse)
deciles <- data.frame(count = 1:10,
coef_maroon = c(0.005, 0.015, 0.015, 0.02, 0.03, 0.07, 0.09, 0.12, 0.12, 0.13),
ci_upper_maroon = c(0.008, 0.02, 0.025, 0.03, 0.04, 0.09, 0.11, 0.14, 0.13, 0.15),
ci_lower_maroon = c(0.001, 0.01, 0.005, 0, 0.01, 0.05, 0.07, 0.11, 0.11, 0.12),
coef_navy= c(0, -200, -400, -600, -800, -700, -900, -900, -1100, -1700),
ci_upper_navy = c(100, -100, -300, -500, -700, -600, -800, -700, -900, -1600),
ci_lower_navy = c(-100, -500, -700, -900, -850, -800, -950, -1000, -1200, -1900))
scl = with(deciles, max(abs(coef_navy))/max(abs(coef_maroon)))
ggplot(deciles) +
geom_point(aes(x = count, y = coef_navy, color = 'navy'),
position = position_nudge(x = -0.05)) +
geom_point(aes(x = count, y = coef_maroon*scl-1900, color = 'maroon'),
position = position_nudge(x = 0.05)) +
geom_errorbar(aes(x = count, ymin = ci_lower_navy,
ymax = ci_upper_navy, color = 'navy', width = 0),
position = position_nudge(x = -0.05)) +
geom_errorbar(aes(x = count, ymin = ci_lower_maroon*scl-1900,
ymax = ci_upper_maroon*scl-1900,
color = 'maroon', width = 0),
position = position_nudge(x = 0.05)) +
labs(x = "Group", y = "") +
scale_color_manual(values = c('maroon', 'navy')) +
scale_y_continuous(sec.axis = sec_axis(~(.+1900)/scl, name = "2nd axis"))
Created on 2021-09-02 by the reprex package (v2.0.1)
You can further trim the 'blank space' at the top if you adjust the expand() option in scale_y_continuous:
library(tidyverse)
deciles <- data.frame(count = 1:10,
coef_maroon = c(0.005, 0.015, 0.015, 0.02, 0.03, 0.07, 0.09, 0.12, 0.12, 0.13),
ci_upper_maroon = c(0.008, 0.02, 0.025, 0.03, 0.04, 0.09, 0.11, 0.14, 0.13, 0.15),
ci_lower_maroon = c(0.001, 0.01, 0.005, 0, 0.01, 0.05, 0.07, 0.11, 0.11, 0.12),
coef_navy= c(0, -200, -400, -600, -800, -700, -900, -900, -1100, -1700),
ci_upper_navy = c(100, -100, -300, -500, -700, -600, -800, -700, -900, -1600),
ci_lower_navy = c(-100, -500, -700, -900, -850, -800, -950, -1000, -1200, -1900))
scl = with(deciles, max(abs(coef_navy))/max(abs(coef_maroon)))
ggplot(deciles) +
geom_point(aes(x = count, y = coef_navy, color = 'navy'),
position = position_nudge(x = -0.05)) +
geom_point(aes(x = count, y = coef_maroon*scl-1900, color = 'maroon'),
position = position_nudge(x = 0.05)) +
geom_errorbar(aes(x = count, ymin = ci_lower_navy,
ymax = ci_upper_navy, color = 'navy', width = 0),
position = position_nudge(x = -0.05)) +
geom_errorbar(aes(x = count, ymin = ci_lower_maroon*scl-1900,
ymax = ci_upper_maroon*scl-1900,
color = 'maroon', width = 0),
position = position_nudge(x = 0.05)) +
labs(x = "Group", y = "") +
scale_color_manual(values = c('maroon', 'navy')) +
scale_y_continuous(sec.axis = sec_axis(~(.+1900)/scl, name = "2nd axis"),
expand = c(0.01,0.01))
Created on 2021-09-02 by the reprex package (v2.0.1)

How to implement the "geom_density_ridges" function

I would like to generate with my data a similar plot as shown with this iris data set.
ggplot(iris, aes(x = Sepal.Length, y = Species)) +
geom_density_ridges(aes(fill = Species)) +
scale_fill_manual(values = c("#00AFBB", "#E7B800", "#FC4E07"))
Here you can see a cutout from my data set.
ratio = c(0, 0.05, 0.1, 0.15, 0.2, 0.25, 0, 0.05, 0.1, 0.15, 0.2, 0.25)
frequency = c(12000, 12300, 9000, 4300, 2434, 18000, 11000, 12200, 8000, 4100, 2400, 15900)
concentration = c("200", "200", "200", "200", "200", "200", "100", "100", "100", "100", "100", "100")
df = cbind(ratio, frequency, concentration)
View(df)
df = as.data.frame(df)
ggplot(df, aes(x = ratio, y = frequency)) +
geom_density_ridges(aes(fill = df$concentration)) +
scale_fill_manual(values = c("#00AFBB", "#E7B800"))
Unfortunately my code does not work. I don't know where my mistake is.
Is this what you're after?
library(ggplot2); library(ggridges)
ggplot(df, aes(x = ratio, y = concentration,
height = frequency/10000, fill = concentration)) +
geom_ridgeline() +
scale_fill_manual(values = c("#00AFBB", "#E7B800"))
data:
df = data.frame(stringsAsFactors = F,
ratio = c(0, 0.05, 0.1, 0.15, 0.2, 0.25, 0, 0.05, 0.1, 0.15, 0.2, 0.25),
frequency = c(12000, 12300, 9000, 4300, 2434, 18000, 11000, 12200, 8000, 4100, 2400, 15900),
concentration = c("200", "200", "200", "200", "200", "200", "100", "100", "100", "100", "100", "100"))

R: Error in heatmap(data) : 'x' must be a numeric matrix. Which 'x' is it referring to?

I am trying to create a heatmap in R. This is my dataset:
Team, Att_L, Att_M, Att_R,
Aston Villa, 0.37, 0.24, 0.39
Birmingham City, 0.34, 0.26, 0.4
Blackburn Rovers, 0.38, 0.26, 0.36
Bolton Wanderers, 0.32, 0.27, 0.41
Brentford, 0.34, 0.28, 0.38
Bristol City, 0.37, 0.26, 0.37
Derby County, 0.34, 0.26, 0.4
Hull City, 0.38, 0.21, 0.41
Ipswich Town, 0.33, 0.24, 0.43
Leeds United, 0.37, 0.24, 0.39
Middlesbrough, 0.37, 0.25, 0.38
Millwall, 0.3, 0.24, 0.46
Norwich City, 0.36, 0.24, 0.4
Nottingham Forest, 0.37, 0.22, 0.41
Preston North End, 0.35, 0.26, 0.39
Queens Park Rangers, 0.35, 0.24, 0.41
Reading, 0.37, 0.23, 0.4
Rotherham United, 0.38, 0.27, 0.35
Sheffield United, 0.41, 0.21, 0.38
Sheffield Wednesday, 0.37, 0.29, 0.34
Stoke City, 0.36, 0.25, 0.39
Swansea City, 0.38, 0.24, 0.38
West Bromwich Albion, 0.38, 0.25, 0.37
Wigan Athletic, 0.38, 0.24, 0.38
It starts off as a tibble called Pitch_axis. I convert this to a table and use gather() to get the data ready for the heatmap.
data2 <- as.data.table(gather(Pitch_axis, variable, value, Att_L:Att_R))
Then I try to run heatmap() on it:
heatmap(data2)
This returns the error:
>Error in heatmap(data2) : 'x' must be a numeric matrix
I don't understand this from two directions: 1. I don't understand which variable is 'x' 2. I tried converting to a matrix and all the observations came out in double "", so presumably as strings.
Any ideas how to fix this?
Try this? Solely representative!
library(tidyverse)
df<-as.tibble(df)
df<-df %>%
gather("id","value",2:ncol(.))
df2<-matrix(df$value,4,8)
heatmap(df2,labRow=df$Team,labCol = df$id)
I eventually got this.
ggplot(data2, aes(Team, variable)) +
geom_tile(aes(fill = value), color = "white") +
scale_fill_gradient(low = "yellow", high = "red") +
ylab("") +
xlab("") +
theme(legend.title = element_text(size = 10),
legend.text = element_text(size = 12),
plot.title = element_text(size=16),
axis.title=element_text(size=14,face="bold"),
axis.text.x = element_text(angle = 90, hjust = 1)) +
ggtitle("Attack more down left, right or centre?",
subtitle = "") +
labs(fill = "%age") +
coord_flip()

Resources