Hi everyone,

 I recently ran into a problem with a plot I'm trying to make. Suppose I
have a plot and want to remove the labels of the x-axis ticks. My first
idea was to just "paint" the labels with empty strings using manual ticks,
but in the attached example this creates an annoying 2.5 label, including
the fact that the plot ticks are different from a plot without the manual
ticks (see attached code below). Do any of you know how to solve this
issue? Is this intended? Is there an easier way of doing this?

Thanks in advance!

####################################################
import numpy as np
from pyx import *

# Generate data:
x = np.arange(51)/10.
y = x

# Define manual ticks to remove the labels of the ticks:
mticks = [graph.axis.tick.tick(1,label=""),graph.axis.tick.tick(2,label=""),
\
               graph.axis.tick.tick(3,label=""),graph.axis.tick.tick(4
,label=""),\
               graph.axis.tick.tick(5,label=""),graph.axis.tick.tick(0
,label="")]

# Plot:
c = canvas.canvas()
g = c.insert(graph.graphxy(height=10,width=15,\
             x = graph.axis.linear(min=0,max=5,manualticks=mticks, title =
'x-axis'),\
             y = graph.axis.linear(min=0,max=5,title = 'y-axis')))

g.plot(graph.data.values(x=x,y=y, title = None),\
          styles = [graph.style.line([color.cmyk.Red,\
                        style.linestyle.dashed,\
                        style.linewidth.thin])])

c.writeEPSfile('plot_example')
c.writePDFfile('plot_example')
####################################################

-- 
Néstor Espinoza
PhD Candidate
Instituto de Astrofísica
Pontificia Universidad Catolica de Chile
Phone (office): (+562) 23547052
Web: http://www.astro.puc.cl/~nespino
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to