Hi

Hope this is the right place to post a request for enhancement.

I often create a bunch of relatively basic plots using matplotlib and
the commands to set the labels and limits take up more space than the
actual plotting commands (figure, plot, show), so I was wondering if
there is a shorter way of doing this (I couldn't find one) and if not,
if a shortcut notation could be added.

Here are some code lines I use at the moment:

3d plot:

ax.set_xlabel('Time [$\mu$s]')
ax.set_xlim3d(-0.2, 0.9)
ax.set_ylabel('Bias [V]')
ax.set_ylim3d(-100, 100)
ax.set_zlabel('Voltage[V]')
ax.set_zlim3d(-0.3, 0.4)

2d plot:

plt.xlabel('Time [$\mu$s]')
plt.ylabel('Voltage [V]')
plt.xlim(0, 100)
plt.ylim(0, 50)



proposed syntax:

# Z being optional
plt.labels(X='Time [$\mu$s]', Y='Bias [V]', Z='Voltage[V]')
plt.limits(X=[-0.2, 0.9], Y=[-100,100], Z=[-0.3, 0.4])



label could also have a **kwargs that would be handed on to all
[xyz]label, in case one needs to set fontsize for all labels.

label could also have an optional title=''.

limits could test for 2d or 3d plots and call the correct functions
automatically.

Arun

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to