本文整理汇总了Python中pyx.canvas.canvas函数的典型用法代码示例。如果您正苦于以下问题:Python canvas函数的具体用法?Python canvas怎么用?Python canvas使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了canvas函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: find
def find(self, file=''):
"""
This is the meat of the algorithm. It takes the frame and runs the steps outlined
in the report. So if you've read the report this should be pretty self explanatory.
"""
dimension = 0
while True:
print '--> generating linear system'
linear_system = self.generate_linear_system()
print ' size is %s, %s' % (len(linear_system), len(linear_system[0]))
print '--> trying to find a solution'
vector_solution = self.solve(linear_system)
if vector_solution is None:
print '--> solution not found'
print '--> doubling along dimension %s' % dimension
self.frame.double(dimension)
dimension = (dimension + 1) % self.dimensions
else:
break
solution = self.normalize_solution(vector_solution)
self.set_edge_weights(solution)
if file:
c = canvas.canvas()
self.draw_edges(c)
c.writePDFfile(file)
开发者ID:erebuseternal,项目名称:kirky,代码行数:25,代码来源:__init__.py
示例2: draw
def draw(self, r=5):
c = canvas.canvas()
x_centre = r + 1
y_centre = r + 1
angle_diff = 2*math.pi/self.n
def get_pos(index):
x_pos = x_centre + math.sin(index*angle_diff)*r
y_pos = y_centre + math.cos(index*angle_diff)*r
return x_pos, y_pos
# nodes
for i in range(self.n):
x, y = get_pos(i)
c.stroke(path.circle(x, y, 1))
c.text(x, y, i)
# edges
for i in range(self.n):
for j in range(self.n):
if math.isnan(self.adj_mat[i, j]):
continue
x1, y1 = get_pos(i)
x2, y2 = get_pos(j)
x_offset = (x2 - x1)/math.sqrt((x1 - x2)**2 + (y1 - y2)**2)
y_offset = (y2 - y1)/math.sqrt((x1 - x2)**2 + (y1 - y2)**2)
arc = path.line(x1 + x_offset, y1 + y_offset, x2 - x_offset, y2 - y_offset)
c.stroke(arc, [deco.earrow()])
c.text((x1 + x2)/2 + x_offset, (y1 + y2)/2 + y_offset, self.adj_mat[i, j]) # moved towards the end pt
c.writePDFfile("graph")
开发者ID:silverfield,项目名称:pythonsessions,代码行数:33,代码来源:graph.py
示例3: make_picture_for_two_vertices
def make_picture_for_two_vertices():
c = canvas.canvas()
c.stroke(path.rect(0, 0, 12, 1))
c.stroke(path.rect(1, 0, 1, 1), [style.linewidth.THICK])
c.stroke(path.rect(5, 0, 1, 1), [style.linewidth.THICK])
c.stroke(path.rect(7, 0, 1, 1), [style.linewidth.THICK])
c.stroke(path.rect(10, 0, 1, 1), [style.linewidth.THICK])
c.stroke(path.line(-0.5, 0.5, -0.5, 6), [deco.earrow(size=0.2)])
c.stroke(path.line(1.5, 0.5, 1.5, 5), [deco.earrow(size=0.2)])
c.stroke(path.line(5.5, 0.5, 5.5, 4), [deco.earrow(size=0.2)])
c.stroke(path.line(7.5, 0.5, 7.5, 3), [deco.earrow(size=0.2)])
c.stroke(path.line(10.5, 0.5, 10.5, 2), [deco.earrow(size=0.2)])
c.stroke(path.line(12.5, 0.5, 12.5, 1), [deco.earrow(size=0.2)])
c.stroke(path.line(5.5, 4, 8, 4), [style.linewidth.THIN])
c.stroke(path.line(7, 3, 8, 3), [style.linewidth.THIN])
c.text(7.5, 3.5, r"$\delta_i = l_i - l_{i + 1}$", [text.halign.boxcenter, text.valign.middle])
c.stroke(path.line(6, 0, 6, -1), [style.linewidth.THIN])
c.stroke(path.line(7, 0, 7, -1), [style.linewidth.THIN])
c.text(6.5, -0.4, r"$d_i$", [text.halign.boxcenter, text.valign.middle])
c.text(-0.5, 3, r"$l_0 = 1.0$", [text.halign.boxleft])
c.text(5.5, 2.5, r"$l_i$", [text.halign.boxright])
c.text(7.5, 2, r"$l_{i+1}$", [text.halign.boxleft])
c.text(12.5, 1.1, r"$l_{E+1} = 0.0$", [text.halign.boxcenter])
c.writePDFfile("test_picture.pdf")
开发者ID:AntipovDen,项目名称:Master,代码行数:25,代码来源:Kmu_plots.py
示例4: main
def main():
out_fname = sys.argv[1]
basedir = '/'.join(os.path.dirname(os.path.realpath(__file__)).split('/')[:-2])
mm9_methods = {
'0 pseudo-counts':'%s/Analysis/hifive_mm9_ESC_bin_correlations.txt' % basedir,
'1 pseudo-count':'%s/Analysis/hifive_mm9_ESC_binPC1_correlations.txt' % basedir,
'3 pseudo-counts':'%s/Analysis/hifive_mm9_ESC_binPC3_correlations.txt' % basedir,
'6 pseudo-counts':'%s/Analysis/hifive_mm9_ESC_binPC6_correlations.txt' % basedir,
'HiCPipe':'%s/Analysis/hicpipe_mm9_ESC_correlations.txt' % basedir,
}
mm9_data = load_data(mm9_methods)
width = 16.8
spacer = 0.4
overall_width = (width - spacer * 2) / 2.6
c = canvas.canvas()
prob_ranges_img, prob_ranges_height = plot_dataset_ranges(mm9_data, width)
prob_ranges_img.text(0, prob_ranges_height, 'a',
[text.halign.left, text.valign.top, text.size(-1)])
c.insert(prob_ranges_img)
overall_height = prob_ranges_height * 0.6
hifive_overall_img = plot_overall(mm9_data, overall_width, overall_height, 'cis')
hifive_overall_img.text(0, overall_height + 0.1, 'b',
[text.halign.left, text.valign.top, text.size(-1)])
c.insert(hifive_overall_img, [trafo.translate(0, -overall_height - spacer)])
hifive_overall_img = plot_overall(mm9_data, overall_width, overall_height, 'trans')
hifive_overall_img.text(0, overall_height + 0.1, 'c',
[text.halign.left, text.valign.top, text.size(-1)])
c.insert(hifive_overall_img,
[trafo.translate(width - overall_width, -overall_height - spacer)])
c.insert(plot_key(overall_width * 0.6 + 0.4, overall_height, mm9_data),
[trafo.translate(overall_width + spacer + 0.6, -overall_height - spacer)])
c.writePDFfile(out_fname)
开发者ID:bxlab,项目名称:HiFive_Paper,代码行数:32,代码来源:pseudocount_comparison.py
示例5: main
def main():
width = 16.8
out_fname = sys.argv[1]
basedir = "%s/Analysis/Timing" % '/'.join(os.path.dirname(os.path.realpath(__file__)).split('/')[:-2])
data_fnames = {
"HiFive-Probability":{'0':"%s/hifive_data" % basedir, '1':"%s/hifive_project" % basedir,
'3':'%s/hifive_prob' % basedir, '4':"%s/hifive_prob_heatmap" % basedir},
"HiFive-Binning":{'0':"%s/hifive_data" % basedir, '1':"%s/hifive_project_nodist" % basedir,
'3':'%s/hifive_bin' % basedir, '4':"%s/hifive_bin_heatmap" % basedir},
"HiFive-Express":{'0':"%s/hifive_data" % basedir, '1':"%s/hifive_project" % basedir,
'3':'%s/hifive_exp' % basedir, '4':"%s/hifive_exp_heatmap" % basedir},
"HiFive-ExpressKR":{'0':"%s/hifive_data" % basedir, '1':"%s/hifive_project_nodist" % basedir,
'3':'%s/hifive_expKR' % basedir, '4':"%s/hifive_expKR_heatmap" % basedir},
"HiFive-ExpressKR w/distance":{'0':"%s/hifive_data" % basedir, '1':"%s/hifive_project" % basedir,
'3':'%s/hifive_expKRdist' % basedir, '4':"%s/hifive_expKRdist_heatmap" % basedir},
"HiCPipe":{'0':"%s/bam2raw" % basedir, '1':"%s/hicpipe_data" % basedir,
'2':'%s/hicpipe_binning' % basedir, '3':'%s/hicpipe_norm' % basedir,
'4':'%s/hicpipe_heatmap' % basedir},
"HiCLib":{'0':"%s/hiclib_mapping" % basedir, '1':'%s/hiclib_data' % basedir,
'3':"%s/hiclib_norm" % basedir, '4':'%s/hiclib_heatmap' % basedir},
"HiCNorm":{'0':"%s/bam2raw" % basedir, '1':"%s/hicpipe_data" % basedir,
"2":"%s/hicnorm_data" % basedir, '3':'%s/hicnorm_norm' % basedir},
}
data = load_data(data_fnames)
c = canvas.canvas()
c.insert(plot_bargraph(data, width, 4.0), [trafo.translate(4.0, 0)])
c.insert(plot_key(width * 0.3, 1.5), [trafo.translate(width * 0.75 - 1.0, 0.2)])
c.writePDFfile(out_fname)
开发者ID:bxlab,项目名称:HiFive_Paper,代码行数:28,代码来源:time_comparison.py
示例6: processPS
def processPS(self, file, writer, context, registry, bbox):
if writer.mesh_as_bitmap:
from pyx import bitmap, canvas
from PIL import Image
c = canvas.canvas()
c.insert(self)
i = Image.open(c.pipeGS("pngalpha", resolution=writer.mesh_as_bitmap_resolution))
i.load()
b = bitmap.bitmap_pt(self.bbox().llx_pt, self.bbox().lly_pt, i)
# we slightly shift the bitmap to re-center it, as the bitmap might contain some additional border
# unfortunately we need to construct another bitmap instance for that ...
b = bitmap.bitmap_pt(self.bbox().llx_pt + 0.5*(self.bbox().width_pt()-b.bbox().width_pt()),
self.bbox().lly_pt + 0.5*(self.bbox().height_pt()-b.bbox().height_pt()), i)
b.processPS(file, writer, context, registry, bbox)
else:
thisbbox = self.bbox()
bbox += thisbbox
file.write("""<< /ShadingType 4
/ColorSpace %s
/BitsPerCoordinate 24
/BitsPerComponent 8
/BitsPerFlag 8
/Decode [%f %f %f %f %s]
/DataSource currentfile /ASCIIHexDecode filter /FlateDecode filter
>> shfill\n""" % (self.elements[0].nodes[0].value.colorspacestring(),
thisbbox.llx_pt, thisbbox.urx_pt, thisbbox.lly_pt, thisbbox.ury_pt,
" ".join(["0 1" for value in self.elements[0].nodes[0].value.to8bitbytes()])))
file.write_bytes(binascii.b2a_hex(zlib.compress(self.data(thisbbox))))
file.write(">\n")
开发者ID:mjg,项目名称:PyX-svn,代码行数:29,代码来源:mesh.py
示例7: try_size
def try_size(self, frame_shape, file=''):
# first we setup the block anew
self.frame = Frame(self.dimensions, self.num_vectors, self.steps)
first_frame_shape = self.get_first_frame_shape()
self.frame.seed_frame(first_frame_shape)
cross_vectors = self.get_cross_vectors()
for vector in cross_vectors:
self.frame.populate(vector)
# now we try to grow our block to the right size
if not self.frame.grow_to_size(frame_shape):
return None
print '--> generating linear system'
linear_system = self.generate_linear_system()
print ' size is %s, %s' % (len(linear_system), len(linear_system[0]))
print '--> trying to find a solution'
vector_solution = self.solve(linear_system)
if vector_solution is None:
print '--> solution not found'
return None
else:
print '--> solution found'
solution = self.normalize_solution(vector_solution)
self.set_edge_weights(solution)
if file:
c = canvas.canvas()
self.draw_edges(c)
c.writePDFfile(file)
开发者ID:erebuseternal,项目名称:kirky,代码行数:27,代码来源:__init__.py
示例8: Draw
def Draw(self, file):
# this simply creates a canvas, draws the interior and exterior and
# then exports it as a PDF
c = canvas.canvas()
DrawBlock(self.block, c)
DrawBlock(self.interior, c)
c.writePDFfile(file)
开发者ID:erebuseternal,项目名称:kirky_devel,代码行数:7,代码来源:__init__.py
示例9: array34
def array34(arange, hlshape=None):
c = canvas.canvas()
if hlshape is None:
c.text(2, 3.3, 'shape=(3, 4)', [text.halign.center])
else:
c.text(2, 3.3, 'shape=%s' % repr(hlshape), [text.halign.center])
if hlshape is not None:
if len(hlshape) == 1:
hlshape = (1, hlshape[0])
if arange:
gridcolor = color.grey(0)
else:
gridcolor = color.grey(0.5)
if hlshape is None:
arange = True
elif (hlshape[0] in (1, 3)) and (hlshape[1] in (1, 4)):
arange = False
else:
arange = None
drawgrid(c, 4, 3, 0, gridcolor, arange=arange)
if hlshape is not None:
c.stroke(path.rect(0, 3, hlshape[1], -hlshape[0]),
[deco.filled([color.rgb(1, 0.8, 0.4)])])
drawgrid(c, hlshape[1], hlshape[0], 3-hlshape[0], arange=False)
if arange is None:
alertcolor = color.rgb(0.6, 0, 0)
c.stroke(path.line(0, 0, 4, 3), [alertcolor, style.linewidth.Thick])
c.stroke(path.line(0, 3, 4, 0), [alertcolor, style.linewidth.Thick])
return c
开发者ID:gertingold,项目名称:euroscipy16-numpy-tutorial,代码行数:29,代码来源:broadcast.py
示例10: main
def main():
out_fname = sys.argv[1]
basedir = '/'.join(os.path.dirname(os.path.realpath(__file__)).split('/')[:-2])
mm9_methods = {
'HiFive-Probability':'%s/Analysis/hifive_mm9_ESC_prob_correlations.txt' % basedir,
'HiFive-Express':'%s/Analysis/hifive_mm9_ESC_exp_correlations.txt' % basedir,
'HiFive-Binning':'%s/Analysis/hifive_mm9_ESC_bin_correlations.txt' % basedir,
}
dist_methods = {
'HiFive-Probability':'%s/Analysis/hifive_mm9_ESC_probnodist_correlations.txt' % basedir,
'HiFive-Express':'%s/Analysis/hifive_mm9_ESC_expnodist_correlations.txt' % basedir,
'HiFive-Binning':'%s/Analysis/hifive_mm9_ESC_binnodist_correlations.txt' % basedir,
}
mm9_data = load_data(mm9_methods)
dist_data = load_data(dist_methods)
width = 16.8
spacer = 0.4
range_width = (width - spacer) / 3.0
c = canvas.canvas()
mm9_ranges_img = plot_dataset_ranges(mm9_data, dist_data, range_width)
c.insert(mm9_ranges_img)
mm9_overall_img = plot_overall(mm9_data, dist_data, range_width, range_width)
mm9_overall_img.text(0, range_width, 'b',
[text.halign.left, text.valign.top, text.size(-1)])
c.insert(mm9_overall_img, [trafo.translate(range_width * 2 + spacer, range_width)])
c.insert(plot_key(range_width / 2, range_width / 2),
[trafo.translate(range_width * 2.25 + spacer, range_width * 0.25)])
c.writePDFfile(out_fname)
开发者ID:bxlab,项目名称:HiFive_Paper,代码行数:28,代码来源:hic_distance_cutoff_comparison.py
示例11: paint
def paint(self, plotitems):
"creates the layout of the key"
columndist_pt = unit.topt(self.columndist)
c = canvas.canvas()
itemspercolumn = (len(plotitems) + self.columns - 1) // self.columns
x_pt = 0
while plotitems:
subc = self.paintcolumn(plotitems[:itemspercolumn])
c.insert(subc, [trafo.translate_pt(x_pt, 0)])
x_pt += unit.topt(subc.bbox().width()) + columndist_pt
del plotitems[:itemspercolumn]
if self.keyattrs is not None:
newc = canvas.canvas()
newc.draw(c.bbox().enlarged(self.border).path(), self.keyattrs)
newc.insert(c)
c = newc
return c
开发者ID:mjg,项目名称:PyX-svn,代码行数:17,代码来源:key.py
示例12: __init__
def __init__(self, nsquares):
self.nsquares = nsquares
self.corners = deque([np.array([0, 0]), np.array([1, 0]),
np.array([1, 1]), np.array([0, 1])])
self.counter = 1
self.initialize_pyx()
self.c = canvas.canvas()
self.draw()
开发者ID:gertingold,项目名称:euroscipy16-numpy-tutorial,代码行数:8,代码来源:fibonacci.py
示例13: plot_key
def plot_key(width, height):
c = canvas.canvas()
w = height / 7.0
for i, meth in enumerate(methods):
c.fill(path.rect(1.0, (6 - i) * w - 0.1, 0.2, 0.2), [method_colors[meth]])
c.text(1.3, (6 - i) * w, "%s" % meth_names[meth],
[text.halign.left, text.valign.middle, text.size(-3)])
return c
开发者ID:bxlab,项目名称:HiFive_Paper,代码行数:8,代码来源:fivec_distance_cutoff_comparison.py
示例14: see_frame
def see_frame(self, file):
for edge in self.frame.coordinate_vectors:
edge.weight = edge.pin
for edge in self.frame.cross_vectors:
edge.weight = edge.pin
c = canvas.canvas()
self.draw_edges(c)
c.writePDFfile(file)
开发者ID:erebuseternal,项目名称:kirky,代码行数:8,代码来源:__init__.py
示例15: plot_key
def plot_key(width, height):
c = canvas.canvas()
step = height / float(len(method_colors))
for i, meth in enumerate(['HiFive-Probability', 'HiFive-Express', 'HiFive-Binning']):
c.fill(path.rect(0.2, height - step * (i + 0.5) - 0.1, 0.2, 0.2),
[method_colors[meth]])
c.text(0.5, height - step * (i + 0.5), meth, [text.halign.left, text.valign.middle, text.size(-2)])
return c
开发者ID:bxlab,项目名称:HiFive_Paper,代码行数:8,代码来源:hic_distance_cutoff_comparison.py
示例16: plot_key
def plot_key(width, height, data):
methods = data.keys()
methods.sort()
c = canvas.canvas()
step = height / float(len(method_colors))
for i, meth in enumerate(methods):
c.fill(path.rect(0.2, height - step * (i + 0.5) - 0.1, 0.2, 0.2),
[method_colors[meth]])
c.text(0.5, height - step * (i + 0.5), meth, [text.halign.left, text.valign.middle, text.size(-2)])
return c
开发者ID:bxlab,项目名称:HiFive_Paper,代码行数:10,代码来源:pseudocount_comparison.py
示例17: main
def main():
out_fname = sys.argv[1]
basedir = '/'.join(os.path.dirname(os.path.realpath(__file__)).split('/')[:-2])
hic_fname1 = "%s/Data/HiC/HiFive/mm9_ESC_NcoI_prob.hcp" % basedir
hic_fname2 = "%s/Data/HiC/HiFive/mm9_ESC_HindIII_prob.hcp" % basedir
fivec_fnames = {
"Prob_Phillips":"%s/Data/FiveC/HiFive/Phillips_ESC_prob.fcp" % basedir,
"Prob_Nora":"%s/Data/FiveC/HiFive/Nora_ESC_male_E14_prob.fcp" % basedir,
"Bin_Phillips":"%s/Data/FiveC/HiFive/Phillips_ESC_bin.fcp" % basedir,
"Bin_Nora":"%s/Data/FiveC/HiFive/Nora_ESC_male_E14_bin.fcp" % basedir,
"Exp_Phillips":"%s/Data/FiveC/HiFive/Phillips_ESC_exp.fcp" % basedir,
"Exp_Nora":"%s/Data/FiveC/HiFive/Nora_ESC_male_E14_exp.fcp" % basedir,
"Exp-KR_Phillips":"%s/Data/FiveC/HiFive/Phillips_ESC_expKR.fcp" % basedir,
"Exp-KR_Nora":"%s/Data/FiveC/HiFive/Nora_ESC_male_E14_expKR.fcp" % basedir,
}
hic1 = hifive.HiC(hic_fname1)
hic2 = hifive.HiC(hic_fname2)
hic_hm = { 'Phillips': {} }
fc = hifive.FiveC(fivec_fnames["Prob_Phillips"])
fragments = fc.frags['fragments'][...]
regions = fc.frags['regions'][...]
for i in range(fc.frags['regions'].shape[0]):
binbounds = numpy.hstack((
fragments['start'][regions['start_frag'][i]:regions['stop_frag'][i]].reshape(-1, 1),
fragments['stop'][regions['start_frag'][i]:regions['stop_frag'][i]].reshape(-1, 1)))
binbounds = binbounds[numpy.where(fc.filter[regions['start_frag'][i]:regions['stop_frag'][i]])[0], :]
hic_hm['Phillips'][i] = dynamically_bin(hic1, hic2, regions['chromosome'][i], binbounds)
fc = hifive.FiveC(fivec_fnames["Prob_Nora"])
fragments = fc.frags['fragments'][...]
regions = fc.frags['regions'][...]
binbounds = numpy.hstack((
fragments['start'][regions['start_frag'][0]:regions['stop_frag'][0]].reshape(-1, 1),
fragments['stop'][regions['start_frag'][0]:regions['stop_frag'][0]].reshape(-1, 1)))
binbounds = binbounds[numpy.where(fc.filter[regions['start_frag'][0]:regions['stop_frag'][0]])[0], :]
hic_hm['Nora'] = dynamically_bin(hic1, hic2, regions['chromosome'][0], binbounds)
dist_corr = find_correlations( hic_hm, fivec_fnames, out_fname, True )
nodist_corr = find_correlations( hic_hm, fivec_fnames, out_fname, False )
c = canvas.canvas()
width = 16.8
spacer = 0.4
plot_width = (width - spacer * 2) / 2.5
plot_height = plot_width
key_width = width - (plot_width + spacer) * 2
phillips_img = plot_correlation_diffs(dist_corr, nodist_corr, 'Phillips', plot_width, plot_height)
nora_img = plot_correlation_diffs(dist_corr, nodist_corr, 'Nora', plot_width, plot_height)
key_img = plot_key(key_width, plot_height)
c.insert(phillips_img)
c.insert(nora_img, [trafo.translate(plot_width + spacer, 0)])
c.insert(key_img, [trafo.translate((plot_width + spacer) * 2, 0)])
c.text(0, plot_height, "a",
[text.halign.left, text.valign.top, text.size(-1)])
c.text(plot_width + spacer, plot_height, "b",
[text.halign.left, text.valign.top, text.size(-1)])
c.writePDFfile(out_fname)
开发者ID:bxlab,项目名称:HiFive_Paper,代码行数:54,代码来源:fivec_distance_cutoff_comparison.py
示例18: build_canvas
def build_canvas():
cnv = canvas.canvas()
cnv.stroke(make_line(w), [deco.earrow()])
text_at(cnv, w / 2. - (.5, 0), r'$\vec{w}$')
cnv.stroke(make_line(v), [deco.earrow()])
text_at(cnv, v / 2. - (0, .5), r'$\vec{v}$')
cnv.stroke(make_line(w, c * v), [deco.earrow(), rgb.red])
text_at(cnv, w - (w - c * v) / 2 + (.1, .1), r'$\vec{w} - c \vec{v}$')
cnv.stroke(make_line(c * v), [deco.earrow(), ls.dashed, rgb.blue])
text_at(cnv, c * v / 1.5 - (0, .5), r'$c \vec{v}$')
cnv.stroke(make_line(v * -1.5, v * 3), [ls.dotted])
return cnv
开发者ID:matthew-brett,项目名称:teaching,代码行数:12,代码来源:vector_projection.py
示例19: axisatv
def axisatv(self, axis, v):
if axis.positioner.fixtickdirection[0]:
# it is a y-axis
t = trafo.translate_pt(self.xpos_pt + v*self.width_pt - axis.positioner.x1_pt, 0)
else:
# it is an x-axis
t = trafo.translate_pt(0, self.ypos_pt + v*self.height_pt - axis.positioner.y1_pt)
c = canvas.canvas()
for layer, subcanvas in axis.canvas.layers.items():
c.layer(layer).insert(subcanvas, [t])
assert len(axis.canvas.layers) == len(axis.canvas.items), str(axis.canvas.items)
axis.canvas = c
开发者ID:asuar078,项目名称:python_workspace,代码行数:12,代码来源:graph.py
示例20: checkone
def checkone(knots, refpoints): # <<<
print(myprint(knots))
mp_make_choices(knots, epsilon)
print(myprint(knots))
c = canvas.canvas()
c.stroke(mypath(knots), [deco.shownormpath(), deco.earrow.normal])
c.writePDFfile(bboxenlarge=unit.t_cm)
c.writeEPSfile(bboxenlarge=unit.t_cm)
c.writeSVGfile(bboxenlarge=unit.t_cm)
check(knots, refpoints)
开发者ID:mjg,项目名称:PyX-svn,代码行数:12,代码来源:test_metapost.py
注:本文中的pyx.canvas.canvas函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论