mirror of
https://github.com/meteoinfo/MeteoInfo.git
synced 2025-12-08 20:36:05 +00:00
add elinewidth and capsize in bar function
This commit is contained in:
parent
50418a3ff4
commit
193ce56a55
@ -235,6 +235,7 @@ public class Axis implements Cloneable {
|
||||
this.tickLabelColor = axis.getTickLabelColor();
|
||||
this.tickLabelFont = axis.getTickLabelFont();
|
||||
this.tickLength = axis.getTickLength();
|
||||
this.tickStroke = axis.tickStroke;
|
||||
this.visible = axis.isVisible();
|
||||
this.position = axis.getPosition();
|
||||
this.positionType = axis.getPositionType();
|
||||
|
||||
@ -70,6 +70,7 @@ public class LonLatAxis extends Axis implements Cloneable {
|
||||
this.tickLabelColor = axis.tickLabelColor;
|
||||
this.tickLabelFont = axis.tickLabelFont;
|
||||
this.tickLength = axis.tickLength;
|
||||
this.tickStroke = axis.tickStroke;
|
||||
this.visible = axis.visible;
|
||||
this.positionType = axis.positionType;
|
||||
this.position = axis.position;
|
||||
|
||||
@ -63,6 +63,7 @@ public class TimeAxis extends Axis implements Cloneable {
|
||||
this.tickLabelColor = axis.tickLabelColor;
|
||||
this.tickLabelFont = axis.tickLabelFont;
|
||||
this.tickLength = axis.tickLength;
|
||||
this.tickStroke = axis.tickStroke;
|
||||
this.visible = axis.visible;
|
||||
this.positionType = axis.positionType;
|
||||
this.position = axis.position;
|
||||
|
||||
@ -1953,6 +1953,7 @@ public class GraphicFactory {
|
||||
PolylineBreak ebreak = new PolylineBreak();
|
||||
ebreak.setColor(bb.getErrorColor());
|
||||
ebreak.setWidth(bb.getErrorSize());
|
||||
float capeSize = bb.getCapSize();
|
||||
double width = widths.getDouble(0);
|
||||
if (autoWidth && xdata.getSize() > 1) {
|
||||
width = (xdata.getDouble(1) - xdata.getDouble(0)) * width;
|
||||
@ -2002,22 +2003,24 @@ public class GraphicFactory {
|
||||
pList = new ArrayList<>();
|
||||
pList.add(new PointD(x + width * 0.5, y - e));
|
||||
pList.add(new PointD(x + width * 0.5, y + e));
|
||||
PolylineShape pls = new PolylineShape();
|
||||
CapPolylineShape pls = new CapPolylineShape();
|
||||
pls.setPoints(pList);
|
||||
pls.setCapLen(capeSize);
|
||||
graphics.add(new Graphic(pls, ebreak));
|
||||
//Add cap
|
||||
/*//Add cap
|
||||
double cape = capeSize == null ? width * 0.25 : capeSize * 0.5;
|
||||
pList = new ArrayList<>();
|
||||
pList.add(new PointD(x + width * 0.25, y - e));
|
||||
pList.add(new PointD(x + width * 0.75, y - e));
|
||||
pList.add(new PointD(x + width * 0.5 - cape, y - e));
|
||||
pList.add(new PointD(x + width * 0.5 + cape, y - e));
|
||||
pls = new PolylineShape();
|
||||
pls.setPoints(pList);
|
||||
graphics.add(new Graphic(pls, ebreak));
|
||||
pList = new ArrayList<>();
|
||||
pList.add(new PointD(x + width * 0.25, y + e));
|
||||
pList.add(new PointD(x + width * 0.75, y + e));
|
||||
pList.add(new PointD(x + width * 0.5 - cape, y + e));
|
||||
pList.add(new PointD(x + width * 0.5 + cape, y + e));
|
||||
pls = new PolylineShape();
|
||||
pls.setPoints(pList);
|
||||
graphics.add(new Graphic(pls, ebreak));
|
||||
graphics.add(new Graphic(pls, ebreak));*/
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
@ -0,0 +1,10 @@
|
||||
package org.meteoinfo.chart.jogl;
|
||||
|
||||
import org.meteoinfo.projection.KnownCoordinateSystems;
|
||||
import org.meteoinfo.projection.ProjectionInfo;
|
||||
|
||||
public class MapPlot3D extends Plot3DGL {
|
||||
private ProjectionInfo projInfo = KnownCoordinateSystems.geographic.world.WGS1984;
|
||||
|
||||
|
||||
}
|
||||
@ -18,8 +18,10 @@ import com.l2fprod.common.beans.ExtendedPropertyDescriptor;
|
||||
import org.meteoinfo.common.Extent;
|
||||
import org.meteoinfo.common.GenericFileFilter;
|
||||
import org.meteoinfo.common.MIMath;
|
||||
import org.meteoinfo.common.colors.ColorMap;
|
||||
import org.meteoinfo.common.util.GlobalUtil;
|
||||
import org.meteoinfo.data.GridArray;
|
||||
import org.meteoinfo.geometry.colors.Normalize;
|
||||
import org.meteoinfo.geometry.legend.LegendScheme;
|
||||
import org.meteoinfo.geometry.legend.LegendType;
|
||||
import org.meteoinfo.geometry.shape.ShapeTypes;
|
||||
@ -222,78 +224,89 @@ public class RasterLayer extends ImageLayer {
|
||||
return image;
|
||||
}
|
||||
|
||||
private BufferedImage getImageFromGridData(GridArray gdata, LegendScheme als) {
|
||||
private BufferedImage getImageFromGridData(GridArray gdata, LegendScheme ls) {
|
||||
int width, height, breakNum;
|
||||
width = gdata.getXNum();
|
||||
height = gdata.getYNum();
|
||||
breakNum = als.getBreakNum();
|
||||
double[] breakValue = new double[breakNum];
|
||||
Color[] breakColor = new Color[breakNum];
|
||||
Color undefColor = this.missingColor;
|
||||
Color defaultColor = als.getLegendBreaks().get(breakNum - 1).getColor();
|
||||
Color color;
|
||||
for (int i = 0; i < breakNum; i++) {
|
||||
breakValue[i] = Double.parseDouble(als.getLegendBreaks().get(i).getEndValue().toString());
|
||||
color = als.getLegendBreaks().get(i).getColor();
|
||||
breakColor[i] = color;
|
||||
if (als.getLegendBreaks().get(i).isNoData()) {
|
||||
undefColor = color;
|
||||
} else {
|
||||
defaultColor = color;
|
||||
}
|
||||
}
|
||||
BufferedImage aImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
|
||||
double value;
|
||||
|
||||
Array data = gdata.getData().copyIfView();
|
||||
double[] values = als.getValues();
|
||||
int n = values.length;
|
||||
int idx;
|
||||
for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width; j++) {
|
||||
value = data.getDouble(i * width + j);
|
||||
if (Double.isNaN(value) || MIMath.doubleEquals(value, gdata.missingValue)) {
|
||||
color = undefColor;
|
||||
if (ls.getColorMap() == null) {
|
||||
breakNum = ls.getBreakNum();
|
||||
double[] breakValue = new double[breakNum];
|
||||
Color[] breakColor = new Color[breakNum];
|
||||
Color undefColor = this.missingColor;
|
||||
Color defaultColor = ls.getLegendBreaks().get(breakNum - 1).getColor();
|
||||
Color color;
|
||||
for (int i = 0; i < breakNum; i++) {
|
||||
breakValue[i] = Double.parseDouble(ls.getLegendBreaks().get(i).getEndValue().toString());
|
||||
color = ls.getLegendBreaks().get(i).getColor();
|
||||
breakColor[i] = color;
|
||||
if (ls.getLegendBreaks().get(i).isNoData()) {
|
||||
undefColor = color;
|
||||
} else {
|
||||
idx = Arrays.binarySearch(values, value);
|
||||
if (als.getLegendType() == LegendType.UNIQUE_VALUE) {
|
||||
if (idx < 0 || idx >= n)
|
||||
color = undefColor;
|
||||
else
|
||||
color = als.getLegendBreak(idx).getColor();
|
||||
} else {
|
||||
if (idx < 0) {
|
||||
if (idx == -1)
|
||||
idx = 0;
|
||||
else if (idx == -n - 1)
|
||||
idx = n - 1;
|
||||
else
|
||||
idx = -idx - 2;
|
||||
} else if (idx == n - 1)
|
||||
idx = n - 2;
|
||||
|
||||
color = als.getLegendBreak(idx).getColor();
|
||||
}
|
||||
defaultColor = color;
|
||||
}
|
||||
}
|
||||
double value;
|
||||
|
||||
Array data = gdata.getData().copyIfView();
|
||||
double[] values = ls.getValues();
|
||||
int n = values.length;
|
||||
int idx;
|
||||
for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width; j++) {
|
||||
value = data.getDouble(i * width + j);
|
||||
if (Double.isNaN(value) || MIMath.doubleEquals(value, gdata.missingValue)) {
|
||||
color = undefColor;
|
||||
} else {
|
||||
idx = Arrays.binarySearch(values, value);
|
||||
if (ls.getLegendType() == LegendType.UNIQUE_VALUE) {
|
||||
if (idx < 0 || idx >= n)
|
||||
color = undefColor;
|
||||
else
|
||||
color = ls.getLegendBreak(idx).getColor();
|
||||
} else {
|
||||
if (idx < 0) {
|
||||
if (idx == -1)
|
||||
idx = 0;
|
||||
else if (idx == -n - 1)
|
||||
idx = n - 1;
|
||||
else
|
||||
idx = -idx - 2;
|
||||
} else if (idx == n - 1)
|
||||
idx = n - 2;
|
||||
|
||||
color = ls.getLegendBreak(idx).getColor();
|
||||
}
|
||||
}
|
||||
aImage.setRGB(j, height - i - 1, color.getRGB());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ColorMap colorMap = ls.getColorMap();
|
||||
int n = colorMap.getColorCount();
|
||||
Normalize normalize = ls.getNormalize();
|
||||
double v;
|
||||
Color fillColor = colorMap.getFillColor();
|
||||
Color color;
|
||||
int idx;
|
||||
for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width; j++) {
|
||||
v = gdata.getDoubleValue(i, j);
|
||||
if (Double.isNaN(v) || MIMath.doubleEquals(v, gdata.missingValue)) {
|
||||
color = fillColor;
|
||||
} else {
|
||||
idx = (int) (normalize.apply(v).floatValue() * n);
|
||||
if (idx < 0)
|
||||
idx = 0;
|
||||
else if (idx >= n)
|
||||
idx = n - 1;
|
||||
color = colorMap.getColor(idx);
|
||||
}
|
||||
aImage.setRGB(j, height - i - 1, color.getRGB());
|
||||
}
|
||||
aImage.setRGB(j, height - i - 1, color.getRGB());
|
||||
}
|
||||
}
|
||||
|
||||
/*for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width; j++) {
|
||||
//oneValue = gdata.data[i][j];
|
||||
value = gdata.getDoubleValue(i, j);
|
||||
if (Double.isNaN(value) || MIMath.doubleEquals(value, gdata.missingValue)) {
|
||||
color = undefColor;
|
||||
} else {
|
||||
color = als.findLegendBreak(value).getColor();
|
||||
}
|
||||
//data[idx++] = oneColor.getRGB();
|
||||
aImage.setRGB(j, height - i - 1, color.getRGB());
|
||||
}
|
||||
}*/
|
||||
//aImage.setRGB(0, 0, width, height, rgb, 0, width);
|
||||
|
||||
return aImage;
|
||||
}
|
||||
|
||||
|
||||
@ -15,6 +15,7 @@ public class BarBreak extends PolygonBreak {
|
||||
// <editor-fold desc="Variables">
|
||||
private Color errorColor;
|
||||
private float errorSize;
|
||||
private float capSize;
|
||||
// </editor-fold>
|
||||
// <editor-fold desc="Constructor">
|
||||
/**
|
||||
@ -24,6 +25,7 @@ public class BarBreak extends PolygonBreak {
|
||||
super();
|
||||
errorColor = Color.black;
|
||||
errorSize = 1.0f;
|
||||
capSize = 0;
|
||||
}
|
||||
// </editor-fold>
|
||||
// <editor-fold desc="Get Set Methods">
|
||||
@ -58,6 +60,22 @@ public class BarBreak extends PolygonBreak {
|
||||
public void setErrorSize(float value){
|
||||
this.errorSize = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cap size
|
||||
* @return Cap size
|
||||
*/
|
||||
public float getCapSize() {
|
||||
return this.capSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set cap size
|
||||
* @param value Cap size
|
||||
*/
|
||||
public void setCapSize(float value) {
|
||||
this.capSize = value;
|
||||
}
|
||||
// </editor-fold>
|
||||
// <editor-fold desc="Methods">
|
||||
// </editor-fold>
|
||||
|
||||
@ -34,6 +34,7 @@ public class PolylineBreak extends ColorBreak {
|
||||
protected Color symbolFillColor;
|
||||
protected boolean fillSymbol;
|
||||
protected int symbolInterval;
|
||||
protected float capSize;
|
||||
// </editor-fold>
|
||||
// <editor-fold desc="Constructor">
|
||||
|
||||
@ -53,6 +54,7 @@ public class PolylineBreak extends ColorBreak {
|
||||
symbolFillColor = symbolColor;
|
||||
fillSymbol = false;
|
||||
symbolInterval = 1;
|
||||
capSize = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -304,6 +306,22 @@ public class PolylineBreak extends ColorBreak {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cap size
|
||||
* @return Cap size
|
||||
*/
|
||||
public float getCapSize() {
|
||||
return this.capSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set cap size
|
||||
* @param value Cap size
|
||||
*/
|
||||
public void setCapSize(float value) {
|
||||
this.capSize = value;
|
||||
}
|
||||
|
||||
// </editor-fold>
|
||||
// <editor-fold desc="Methods">
|
||||
|
||||
|
||||
@ -1,32 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<MeteoInfo File="milconfig.xml" Type="configurefile">
|
||||
<Path OpenPath="D:\Temp\LaSW\script">
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\plot"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\chart\latex"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\chart"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\common_math\stats"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\common_math"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\chart\legend"/>
|
||||
<Path OpenPath="D:\Working\MIScript\Jython\mis\plot_types\bar">
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\array"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\satellite"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\contour"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\scatter"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\chart"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\chart\axis"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\contour"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d_earth"/>
|
||||
<RecentFolder Folder="D:\Temp\LaSW\script"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\bar"/>
|
||||
</Path>
|
||||
<File>
|
||||
<OpenedFiles>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\satellite\OMPS-NPP_LP-L2_2.py"/>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\volumeplot_1.py"/>
|
||||
<OpenedFile File="D:\Temp\LaSW\script\typhoon_slice.py"/>
|
||||
<OpenedFile File="D:\Temp\LaSW\script\typhoon_map_volume.py"/>
|
||||
</OpenedFiles>
|
||||
<RecentFiles>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\satellite\OMPS-NPP_LP-L2_2.py"/>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\volumeplot_1.py"/>
|
||||
<RecentFile File="D:\Temp\LaSW\script\typhoon_slice.py"/>
|
||||
<RecentFile File="D:\Temp\LaSW\script\typhoon_map_volume.py"/>
|
||||
</RecentFiles>
|
||||
</File>
|
||||
<Font>
|
||||
@ -34,5 +32,5 @@
|
||||
</Font>
|
||||
<LookFeel DockWindowDecorated="true" LafDecorated="true" Name="FlatDarkLaf"/>
|
||||
<Figure DoubleBuffering="true"/>
|
||||
<Startup MainFormLocation="-7,-7" MainFormSize="1293,685"/>
|
||||
<Startup MainFormLocation="-7,0" MainFormSize="1458,847"/>
|
||||
</MeteoInfo>
|
||||
|
||||
Binary file not shown.
@ -508,40 +508,44 @@ class Axes(object):
|
||||
:param timetickformat: (*string*) Time tick label format.
|
||||
'''
|
||||
ax = self.axes
|
||||
b_axis = ax.getAxis(Location.BOTTOM)
|
||||
t_axis = ax.getAxis(Location.TOP)
|
||||
if axistype == 'lon':
|
||||
b_axis = LonLatAxis(ax.getAxis(Location.BOTTOM))
|
||||
#b_axis.setLabel('Longitude')
|
||||
if not isinstance(b_axis, LonLatAxis):
|
||||
b_axis = LonLatAxis(b_axis)
|
||||
b_axis.setLongitude(True)
|
||||
ax.setAxis(b_axis, Location.BOTTOM)
|
||||
t_axis = LonLatAxis(ax.getAxis(Location.TOP))
|
||||
#t_axis.setLabel('Longitude')
|
||||
if not isinstance(t_axis, LonLatAxis):
|
||||
t_axis = LonLatAxis(t_axis)
|
||||
t_axis.setLongitude(True)
|
||||
ax.setAxis(t_axis, Location.TOP)
|
||||
elif axistype == 'lat':
|
||||
b_axis = LonLatAxis(ax.getAxis(Location.BOTTOM))
|
||||
#b_axis.setLabel('Latitude')
|
||||
if not isinstance(b_axis, LonLatAxis):
|
||||
b_axis = LonLatAxis(b_axis)
|
||||
b_axis.setLongitude(False)
|
||||
ax.setAxis(b_axis, Location.BOTTOM)
|
||||
t_axis = LonLatAxis(ax.getAxis(Location.TOP))
|
||||
#t_axis.setLabel('Latitude')
|
||||
if not isinstance(t_axis, LonLatAxis):
|
||||
t_axis = LonLatAxis(t_axis)
|
||||
t_axis.setLongitude(False)
|
||||
ax.setAxis(t_axis, Location.TOP)
|
||||
elif axistype == 'time':
|
||||
b_axis = TimeAxis(ax.getAxis(Location.BOTTOM))
|
||||
if not isinstance(b_axis, TimeAxis):
|
||||
b_axis = TimeAxis(b_axis)
|
||||
ax.setAxis(b_axis, Location.BOTTOM)
|
||||
t_axis = TimeAxis(ax.getAxis(Location.TOP))
|
||||
if not isinstance(t_axis, TimeAxis):
|
||||
t_axis = TimeAxis(t_axis)
|
||||
ax.setAxis(t_axis, Location.TOP)
|
||||
if not timetickformat is None:
|
||||
ax.getAxis(Location.BOTTOM).setTimeFormat(timetickformat)
|
||||
ax.getAxis(Location.TOP).setTimeFormat(timetickformat)
|
||||
b_axis.setTimeFormat(timetickformat)
|
||||
t_axis.setTimeFormat(timetickformat)
|
||||
elif axistype == 'log':
|
||||
b_axis = LogAxis(ax.getAxis(Location.BOTTOM))
|
||||
#b_axis.setLabel('Log')
|
||||
b_axis.setMinorTickNum(10)
|
||||
if not isinstance(b_axis, LogAxis):
|
||||
b_axis = LogAxis(b_axis)
|
||||
b_axis.setMinorTickNum(10)
|
||||
ax.setAxis(b_axis, Location.BOTTOM)
|
||||
t_axis = LogAxis(ax.getAxis(Location.TOP))
|
||||
#t_axis.setLabel('Log')
|
||||
t_axis.setMinorTickNum(10)
|
||||
if not isinstance(t_axis, LogAxis):
|
||||
t_axis = LogAxis(t_axis)
|
||||
t_axis.setMinorTickNum(10)
|
||||
ax.setAxis(t_axis, Location.TOP)
|
||||
else:
|
||||
b_axis = Axis(ax.getAxis(Location.BOTTOM))
|
||||
@ -1717,8 +1721,11 @@ class Axes(object):
|
||||
:param hatchsize: (*int*) Hatch size. Default is None (8).
|
||||
:param bgcolor: (*Color*) Background color, only valid with hatch.
|
||||
:param barswidth: (*float*) Bars width (0 - 1), only used for automatic bar with plot
|
||||
(only one argument widthout ``width`` augument). Defaul is 0.8.
|
||||
:param morepoints: (*boolean*) More points in bar rectangle. Defaul is False.
|
||||
(only one argument without ``width`` argument). Default is 0.8.
|
||||
:param ecolor: (*Color*) The line color of the errorbars. Default is black.
|
||||
:param elinewidth: (*float*) The line width of the errorbars.
|
||||
:param capsize: (*float*) The length of the error bar caps in pixels. Default is 0.
|
||||
:param morepoints: (*boolean*) More points in bar rectangle. Default is False.
|
||||
|
||||
:returns: Bar legend break.
|
||||
|
||||
@ -1778,6 +1785,8 @@ class Axes(object):
|
||||
bgcolor = plotutil.getcolor(bgcolor)
|
||||
ecolor = kwargs.pop('ecolor', 'k')
|
||||
ecolor = plotutil.getcolor(ecolor)
|
||||
elinewidth = kwargs.pop('elinewidth', None)
|
||||
capsize = kwargs.pop('capsize', None)
|
||||
morepoints = kwargs.pop('morepoints', False)
|
||||
barbreaks = []
|
||||
for color in colors:
|
||||
@ -1796,6 +1805,10 @@ class Axes(object):
|
||||
if not hatchsize is None:
|
||||
lb.setStyleSize(hatchsize)
|
||||
lb.setErrorColor(ecolor)
|
||||
if not elinewidth is None:
|
||||
lb.setErrorSize(elinewidth)
|
||||
if not capsize is None:
|
||||
lb.setCapSize(capsize)
|
||||
barbreaks.append(lb)
|
||||
|
||||
#Create bar graphics
|
||||
|
||||
Binary file not shown.
@ -32,6 +32,7 @@ from mipylib.numeric.core import NDArray, DimArray
|
||||
from mipylib.geolib.milayer import MILayer
|
||||
import mipylib.geolib.migeo as migeo
|
||||
import plotutil
|
||||
import colors
|
||||
import mipylib.migl as migl
|
||||
import mipylib.miutil as miutil
|
||||
|
||||
@ -1239,8 +1240,10 @@ class MapAxes(Axes):
|
||||
y = plotutil.getplotdata(y)
|
||||
layer = DrawMeteoData.createImageLayer(x, y, igraphic, 'layer_image')
|
||||
else:
|
||||
if len(args) > 0:
|
||||
if ls is None:
|
||||
if ls is None:
|
||||
vmin = kwargs.pop('vmin', gdata.min())
|
||||
vmax = kwargs.pop('vmax', gdata.max())
|
||||
if len(args) > 0:
|
||||
level_arg = args[0]
|
||||
if isinstance(level_arg, int):
|
||||
cn = level_arg
|
||||
@ -1249,9 +1252,11 @@ class MapAxes(Axes):
|
||||
if isinstance(level_arg, NDArray):
|
||||
level_arg = level_arg.aslist()
|
||||
ls = LegendManage.createImageLegend(gdata, level_arg, cmap)
|
||||
else:
|
||||
if ls is None:
|
||||
else:
|
||||
ls = LegendManage.createImageLegend(gdata, cmap)
|
||||
norm = kwargs.pop('norm', colors.Normalize(vmin, vmax))
|
||||
ls.setNormalize(norm._norm)
|
||||
ls.setColorMap(cmap)
|
||||
plotutil.setlegendscheme(ls, **kwargs)
|
||||
fill_color = kwargs.pop('fill_color', None)
|
||||
if not fill_color is None:
|
||||
|
||||
Binary file not shown.
@ -481,8 +481,11 @@ def bar(x, height, width=0.8, bottom=None, align='center', data=None, **kwargs):
|
||||
:param hatchsize: (*int*) Hatch size. Default is None (8).
|
||||
:param bgcolor: (*Color*) Background color, only valid with hatch.
|
||||
:param barswidth: (*float*) Bars width (0 - 1), only used for automatic bar with plot
|
||||
(only one argument widthout ``width`` augument). Defaul is 0.8.
|
||||
:param morepoints: (*boolean*) More points in bar rectangle. Defaul is False.
|
||||
(only one argument without ``width`` argument). Default is 0.8.
|
||||
:param ecolor: (*Color*) The line color of the errorbars. Default is black.
|
||||
:param elinewidth: (*float*) The line width of the errorbars.
|
||||
:param capsize: (*float*) The length of the error bar caps in pixels. Default is 0.
|
||||
:param morepoints: (*boolean*) More points in bar rectangle. Default is False.
|
||||
|
||||
:returns: Bar legend break.
|
||||
|
||||
@ -1326,7 +1329,11 @@ def axes3d(*args, **kwargs):
|
||||
"""
|
||||
opengl = kwargs.pop('opengl', True)
|
||||
if opengl:
|
||||
earth = kwargs.pop('earth', False)
|
||||
projection = kwargs.pop('projection', None)
|
||||
if projection is None:
|
||||
earth = kwargs.pop('earth', False)
|
||||
else:
|
||||
earth = projection == 'earth'
|
||||
if earth:
|
||||
return axes3d_earth(*args, **kwargs)
|
||||
else:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user