Re: [閒聊] 恭喜開板:)
看板Mathematica作者chungyuandye (養花種魚數月亮賞星星)時間13年前 (2011/06/25 21:57)推噓5(5推 0噓 1→)留言6則, 4人參與討論串2/4 (看更多)
※ 引述《apruth (L's celebrate!)》之銘言:
: 恭喜開板呀^^
: 哈哈
: 我好前面
恭喜開版~~just for fun
str[x_] :=
"http://images.google.com.tw/images?um=1&hl=zh-TW&tbs=isch:1&q=%E6%\
9E%97%E5%BF%97%E7%8E%B2&sa=N&start=" <> ToString[18*x] <> "&ndsp=" <>
ToString[18]
mypic = ImageResize[#, RandomInteger[{1, 50}]] & /@
Flatten[Import[str[#], {"Html", "Images"}][[2 ;; -1]] & /@
Range[20]];
myplot[str_, size_] :=
Module[{mystr = str, test, a, b, mysize = size, data},
test = Rasterize[str, RasterSize -> 20, ImageSize -> 500];
{a, b} = Dimensions[test[[1, 1]]][[1 ;; 2]];
data = Reverse[#] & /@
Select[Flatten[
Table[If[
And[test[[1, 1, i, j]][[1]] > 100,
test[[1, 1, i, j]][[2]] > 100,
test[[1, 1, i, j]][[3]] > 100], {0, 0}, {i, j}], {i, a}, {j,
b}], 1], # != {0, 0} &];
ListPlot[data, PlotStyle -> PointSize[0.01], ImageSize -> mysize,
AspectRatio -> 1, Frame -> False, Axes -> {None, None},
PlotRange -> {{-0.2 Min[data[[All, 1]]],
1.1 Max[data[[All, 1]]]}, {0.2 Min[data[[All, 2]]],
1.1 Max[data[[All, 2]]]}},
Epilog -> {{PointSize[RandomReal[{0, 1/10}]],
RGBColor[Random[], Random[], Random[]], Point[{#}]} & /@
data}]]
mypicplot[str_, size_] :=
Module[{mystr = str, test, a, b, mysize = size, data},
test = Rasterize[str, RasterSize -> 50, ImageSize -> mysize];
{a, b} = Dimensions[test[[1, 1]]][[1 ;; 2]];
data = Reverse[#] & /@
Select[Flatten[
Table[If[
And[test[[1, 1, i, j]][[1]] > 100,
test[[1, 1, i, j]][[2]] > 100,
test[[1, 1, i, j]][[3]] > 100], {0, 0}, {i, j}], {i, a}, {j,
b}], 1], # != {0, 0} &];
ListPlot[RandomSample[Partition[data, 1], Length@data],
PlotMarkers ->
Evaluate[
Rotate[#, Random[]*Pi] & /@ RandomChoice[mypic, Length@data]],
Frame -> False, Axes -> {None, None},
PlotRange -> {{-0.2 Min[data[[All, 1]]],
1.1 Max[data[[All, 1]]]}, {0.2 Min[data[[All, 2]]],
1.1 Max[data[[All, 2]]]}}, ImageSize -> mysize]]
myplot[\[HeartSuit], 500]
mypicplot[M, 1000]
--
我打研究室走過 那獨坐電腦前的容顏如苦瓜的糾結
靈感不來 長壽的煙霧不散
研究室如小小的寂寞的城 恰如商管的電梯向晚
http://chungyuandye.twbbs.org
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.173.132.228
推
06/25 23:09, , 1F
06/25 23:09, 1F
推
06/25 23:09, , 2F
06/25 23:09, 2F
推
06/26 02:14, , 3F
06/26 02:14, 3F
推
06/26 03:16, , 4F
06/26 03:16, 4F
→
06/26 08:57, , 5F
06/26 08:57, 5F
推
06/28 15:36, , 6F
06/28 15:36, 6F
討論串 (同標題文章)
Mathematica 近期熱門文章
PTT數位生活區 即時熱門文章