Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Packages/vcs/Lib/vcs2vtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ def prepMarker(renWin,marker,cmap=None):
# Use the difference in x to scale the point, as later we'll use the
# x range to correct the aspect ratio:
dx = marker.worldcoordinate[1] - marker.worldcoordinate[0]
s *= float(dx)/500.
s *= abs(float(dx))/500.
gs.SetScale(s)
gs.Update()

Expand Down
6 changes: 6 additions & 0 deletions testing/vcs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ add_test(vcs_test_taylor_2_quads
${cdat_SOURCE_DIR}/testing/vcs/test_1D_with_manyDs.py
"${BASELINE_DIR}/test_1D_with_manyDs.png"
)
add_test(vcs_test_1d_marker_not_shown_if_xaxis_flipped
${CMAKE_INSTALL_PREFIX}/bin/python
${cdat_SOURCE_DIR}/testing/vcs/test_1d_marker_not_shown_if_xaxis_flipped.py
${BASELINE_DIR}/test_1d_marker_not_shown_if_xaxis_flipped.png
)


# These test actually plot things need sample data
if (CDAT_DOWNLOAD_SAMPLE_DATA)
Expand Down
41 changes: 41 additions & 0 deletions testing/vcs/test_1d_marker_not_shown_if_xaxis_flipped.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import vcs
import numpy
import MV2
import cdms2
import sys
import os

src=sys.argv[1]
pth = os.path.join(os.path.dirname(__file__),"..")
sys.path.append(pth)
import checkimage

x=vcs.init()
x.drawlogooff()
x.setbgoutputdimensions(1200,1091,units="pixels")

data = MV2.array([4,5,6,7,1,3,7,9,])+230.

p = cdms2.createAxis([2,5,100,200,500,800,850,1000])

data.setAxis(0,p)

data.id="jim"

gm=x.create1d()

gm.linewidth=0
gm.datawc_x1=1000
gm.datawc_x2=0

gm.markersize=30

x.plot(data,gm,bg=1)

fnm = "test_1d_marker_not_shown_if_xaxis_flipped.png"
x.png(fnm)

print "fnm:",fnm
print "src:",src
ret = checkimage.check_result_image(fnm,src,checkimage.defaultThreshold)
sys.exit(ret)