clip_on was a suggested way of getting around the clipping that happens at the edge of a frame. In the Sage project, we are always setting the limits on the axes via set_xlim and set_ylim. Is there any way to get the lines and circles that pass across the edge of the usual clip boundary to still be drawn, even if we have set the xlim and ylim of the axis?
Basically (using an example from the gallery), is there a way to get the scatter plot circles below not clipped, while still having the y-axis only go from -2 to 2? If not, is there a way to easily calculate the protrusion of the various objects, like the circles below, so we know how much to adjust the axes to just include the circles?
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
x = np.linspace(0r,2*np.pi,100r)
y = 2*np.sin(x)
ax = fig.add_subplot(1,1,1)
q=ax.scatter(x,y)
ax.set_ylim([-2,2])
q.set_clip_on(False)
ax.set_clip_on(False)
ax.spines['left'].set_position(('outward',10))
ax.spines['bottom'].set_position(('outward',10))
ax.spines['top'].set_color('none')
ax.spines['right'].set_color('none')
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
fig.savefig('test.png')
Another idea would be to disable clipping specifically for any markers
at xlim[0] <= markerx <= xlim[1].
I'll talk about this with John and other interested parties at the SciPy
conference (will you be there?) and hopefully address this issue during
the sprint, where I'm planning to work on MPL.
clip_on was a suggested way of getting around the clipping that happens
at the edge of a frame. In the Sage project, we are always setting the
limits on the axes via set_xlim and set_ylim. Is there any way to get
the lines and circles that pass across the edge of the usual clip
boundary to still be drawn, even if we have set the xlim and ylim of the
axis?
Basically (using an example from the gallery), is there a way to get the
scatter plot circles below not clipped, while still having the y-axis
only go from -2 to 2? If not, is there a way to easily calculate the
protrusion of the various objects, like the circles below, so we know
how much to adjust the axes to just include the circles?
clip_on was a suggested way of getting around the clipping that happens at the edge of a frame. In the Sage project, we are always setting the limits on the axes via set_xlim and set_ylim. Is there any way to get the lines and circles that pass across the edge of the usual clip boundary to still be drawn, even if we have set the xlim and ylim of the axis?
Basically (using an example from the gallery), is there a way to get the scatter plot circles below not clipped, while still having the y-axis only go from -2 to 2? If not, is there a way to easily calculate the protrusion of the various objects, like the circles below, so we know how much to adjust the axes to just include the circles?
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
x = np.linspace(0r,2*np.pi,100r)
y = 2*np.sin(x)
ax = fig.add_subplot(1,1,1)
q=ax.scatter(x,y)
ax.set_ylim([-2,2])
q.set_clip_on(False)
ax.set_clip_on(False)
ax.spines['left'].set_position(('outward',10))
ax.spines['bottom'].set_position(('outward',10))
ax.spines['top'].set_color('none')
ax.spines['right'].set_color('none')
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
fig.savefig('test.png')
Thanks,
Jason
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net matplotlib-devel List Signup and Options
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
clip_on was a suggested way of getting around the clipping that happens at the edge of a frame. In the Sage project, we are always setting the limits on the axes via set_xlim and set_ylim. Is there any way to get the lines and circles that pass across the edge of the usual clip boundary to still be drawn, even if we have set the xlim and ylim of the axis?
Basically (using an example from the gallery), is there a way to get the scatter plot circles below not clipped, while still having the y-axis only go from -2 to 2? If not, is there a way to easily calculate the protrusion of the various objects, like the circles below, so we know how much to adjust the axes to just include the circles?
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
x = np.linspace(0r,2*np.pi,100r)
y = 2*np.sin(x)
ax = fig.add_subplot(1,1,1)
q=ax.scatter(x,y)
ax.set_ylim([-2,2])
q.set_clip_on(False)
ax.set_clip_on(False)
ax.spines['left'].set_position(('outward',10))
ax.spines['bottom'].set_position(('outward',10))
ax.spines['top'].set_color('none')
ax.spines['right'].set_color('none')
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
fig.savefig('test.png')
Thanks,
Jason
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net matplotlib-devel List Signup and Options
clip_on was a suggested way of getting around the clipping that happens at the edge of a frame. In the Sage project, we are always setting the limits on the axes via set_xlim and set_ylim. Is there any way to get the lines and circles that pass across the edge of the usual clip boundary to still be drawn, even if we have set the xlim and ylim of the axis?
Basically (using an example from the gallery), is there a way to get the scatter plot circles below not clipped, while still having the y-axis only go from -2 to 2? If not, is there a way to easily calculate the protrusion of the various objects, like the circles below, so we know how much to adjust the axes to just include the circles?
Another idea would be to disable clipping specifically for any markers
at xlim[0] <= markerx <= xlim[1].
I'll talk about this with John and other interested parties at the SciPy
conference (will you be there?) and hopefully address this issue during
the sprint, where I'm planning to work on MPL.
No, I won't be there, but I'm excited to hear what comes out of the sprint.
Andrew, thanks for suggesting a way to get this to work. Michael and Eric, thanks for finding a fix for the general problem.
I'm impressed at how quickly developers respond to questions here! I am really, really glad that Sage is using matplotlib for 2d graphics.