use of tech.tablesaw.plotly.components.Figure in project tablesaw by jtablesaw.
the class MarkerOptionsExample method showCustomLine.
/**
* Shows a scatter with an outline on the marker
*/
private void showCustomLine() {
Layout layout = Layout.builder().title("outline").xAxis(Axis.builder().title("Batting Average").build()).yAxis(Axis.builder().title("Wins").build()).build();
Trace trace = ScatterTrace.builder(x, y).marker(Marker.builder().line(Line.builder().color("rgb(231, 99, 250)").width(1).build()).build()).build();
Plot.show(new Figure(layout, trace));
}
use of tech.tablesaw.plotly.components.Figure in project tablesaw by jtablesaw.
the class MarkerOptionsExample method showMarkerGradient.
/**
* Shows a scatter with a gradient. In this example we set both the type and the color (which is
* used as the value to shade into). Color normally defaults to a dark neutral grey (black?)
*
* <p>The size is increased to make the gradient more visible
*/
private void showMarkerGradient() {
Layout layout = Layout.builder().title("marker gradient").xAxis(Axis.builder().title("Batting Average").build()).yAxis(Axis.builder().title("Wins").build()).build();
Trace trace = ScatterTrace.builder(x, y).marker(Marker.builder().size(10).gradient(Gradient.builder().type(Gradient.Type.HORIZONTAL).color("red").build()).build()).build();
Plot.show(new Figure(layout, trace));
}
use of tech.tablesaw.plotly.components.Figure in project tablesaw by jtablesaw.
the class MarkerOptionsExample method showLargeMarkers.
/**
* Shows a scatter with large markers
*/
private void showLargeMarkers() {
Layout layout = Layout.builder().title("large markers").xAxis(Axis.builder().title("Batting Average").build()).yAxis(Axis.builder().title("Wins").build()).build();
Trace trace = ScatterTrace.builder(x, y).marker(Marker.builder().size(9).build()).build();
Plot.show(new Figure(layout, trace));
}
use of tech.tablesaw.plotly.components.Figure in project tablesaw by jtablesaw.
the class MarkerOptionsExample method showColorScale.
/**
* Shows a scatter with color set as a color scale
*
* <p>The color scale requires that an array of numeric values be provided, here we just scale
* according to the number of wins the team has.
*/
private void showColorScale() {
Layout layout = Layout.builder().title("color scaled by # of wins").xAxis(Axis.builder().title("Batting Average").build()).yAxis(Axis.builder().title("Wins").build()).build();
IntColumn wins = baseball.intColumn("W");
Trace trace = ScatterTrace.builder(x, y).marker(Marker.builder().color(wins.asDoubleArray()).cMinAndMax(wins.min(), wins.max()).colorScale(Marker.Palette.YL_GN_BU).build()).build();
Plot.show(new Figure(layout, trace));
}
use of tech.tablesaw.plotly.components.Figure in project tablesaw by jtablesaw.
the class MarkerOptionsExample method showRGBColor.
/**
* Shows a scatter with color set as RGB value
*/
private void showRGBColor() {
Layout layout = Layout.builder().title("RGB value used for marker color").xAxis(Axis.builder().title("Batting Average").build()).yAxis(Axis.builder().title("Wins").build()).build();
Trace trace = ScatterTrace.builder(x, y).marker(Marker.builder().color("rgb(17, 157, 255)").build()).build();
Plot.show(new Figure(layout, trace));
}
Aggregations