SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: LowDepth <Hag...@gm...> - 2015年04月08日 16:49:58
Hello, 
how can I plot circles or other shapes in plots which have logarithmic axis? 
I have a grid of 3 plots and want to plot some kind of sketches in the lower
right corner of
each subplot. How should I do that?
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import gridspec
fig = plt.figure(figsize=(6, 10)) 
gs = gridspec.GridSpec(3, 1, height_ratios=[1.5, 1, 1])#, height_ratios=[2,
1, 1])
ax0 = plt.subplot(gs[0])
ax1 = plt.subplot(gs[1])
ax2 = plt.subplot(gs[2])
plt.setp(ax_new.get_yticklabels(), visible=False)
plt.setp(ax_new.get_xticklabels(), visible=False)
ax_new = fig.add_axes([0,0,1,1], frameon=False,aspect="equal")
ax_new.axes.get_yaxis().set_visible(False)
ax_new.axes.get_xaxis().set_visible(False)
circle1=plt.Circle((0.2,0.0),0.05, color="0.8")
circle2=plt.Circle((0.4,0.0),0.05, color="0.8")
ax_new.add_artist(circle1)
ax_new.add_artist(circle2)
ax0.semilogx(x,x**2, "k-", linewidth=2)
ax1.semilogx(x,x**3, "k--", linewidth=2)
ax2.semilogx(x,np.exp(-x)+x**4, "k-.", linewidth=2)
plt.tight_layout()
plt.show()
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/How-to-draw-circles-in-logscale-plots-tp45367.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Benjamin R. <ben...@ou...> - 2015年05月07日 15:28:32
A quick-n-dirty way would be to use markers via the scatter() function.
Just set the facecolor to 'none', and some very large markersize value.
Ben Root
On Wed, Apr 8, 2015 at 12:49 PM, LowDepth <Hag...@gm...> wrote:
> Hello,
>
> how can I plot circles or other shapes in plots which have logarithmic
> axis?
> I have a grid of 3 plots and want to plot some kind of sketches in the
> lower
> right corner of
> each subplot. How should I do that?
>
> import numpy as np
> from matplotlib import pyplot as plt
> from matplotlib import gridspec
>
> fig = plt.figure(figsize=(6, 10))
> gs = gridspec.GridSpec(3, 1, height_ratios=[1.5, 1, 1])#, height_ratios=[2,
> 1, 1])
> ax0 = plt.subplot(gs[0])
> ax1 = plt.subplot(gs[1])
> ax2 = plt.subplot(gs[2])
> plt.setp(ax_new.get_yticklabels(), visible=False)
> plt.setp(ax_new.get_xticklabels(), visible=False)
> ax_new = fig.add_axes([0,0,1,1], frameon=False,aspect="equal")
> ax_new.axes.get_yaxis().set_visible(False)
> ax_new.axes.get_xaxis().set_visible(False)
> circle1=plt.Circle((0.2,0.0),0.05, color="0.8")
> circle2=plt.Circle((0.4,0.0),0.05, color="0.8")
> ax_new.add_artist(circle1)
> ax_new.add_artist(circle2)
>
> ax0.semilogx(x,x**2, "k-", linewidth=2)
> ax1.semilogx(x,x**3, "k--", linewidth=2)
> ax2.semilogx(x,np.exp(-x)+x**4, "k-.", linewidth=2)
> plt.tight_layout()
> plt.show()
>
>
>
> --
> View this message in context:
> http://matplotlib.1069221.n5.nabble.com/How-to-draw-circles-in-logscale-plots-tp45367.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /