ファイル:Rosenbrock function.svg

ページのコンテンツが他言語でサポートされていません。

元のファイル(SVG ファイル、720 × 540 ピクセル、ファイルサイズ: 2.28メガバイト)

概要

解説
English: Rosenbrock function over . The Python code needs at least Matplotlib v0.99. The MATLAB/Octave code was tested with GNU Octave 4.2.2 and MATLAB R2016a.
Español: Funció de Rosenbrock definida sobre .
日付
原典 投稿者自身による著作物
作者 Morn the Gorn
Python source
InfoField
click to expand
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.colors import LogNorm
import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax = Axes3D(fig, azim=-128, elev=43)
s = .05
X = np.arange(-2, 2.+s, s)
Y = np.arange(-1, 3.+s, s)
X, Y = np.meshgrid(X, Y)
Z = (1.-X)**2 + 100.*(Y-X*X)**2
# ax.plot_surface(X, Y, Z, rstride=1, cstride=1, norm = LogNorm(),
#                 cmap="viridis")
# Without using `` linewidth=0, edgecolor='none' '', the code may produce a
# graph with wide black edges, which will make the surface look much darker
# than the one illustrated in the figure above.
ax.plot_surface(X, Y, Z, rstride=1, cstride=1, norm=LogNorm(),
                linewidth=0, edgecolor='none', cmap="viridis")

# Set the axis limits so that they are the same as in the figure above.
ax.set_xlim([-2, 2.0])                                                       
ax.set_ylim([-1, 3.0])                                                       
ax.set_zlim([0, 2500]) 

plt.xlabel("x")
plt.ylabel("y")
plt.savefig("Rosenbrock function.svg", bbox_inches="tight")

plt.show()
MATLAB/Octave source
InfoField
click to expand
clear all;
close all;
hfig = figure(1);

s = 0.05;
X = [-2 : s : 2+s];
Y = [-1 : s : 3+s];
[X, Y] = meshgrid(X, Y);
Z = (1-X).^2 + 100*(Y-X.^2).^2;

% Use log scale of Z for a batter usage of the color spectrum  
minZ = min(Z(:));  
maxZ = max(Z(:));
C = minZ + (maxZ-minZ).*log(1+Z-minZ)./log(1+maxZ-minZ); 
% See
% http://stackoverflow.com/questions/5073865/how-to-color-surface-with-stronger-contrast
% for how to color a surface with a even stronger contrast.   
% The method is as follows:
%C = Z;
%[~, index] = sort(C(:));
%C(index) = 1 : numel(index);

colormap(jet);
surf(X, Y, Z, C, 'EdgeColor', 'none', 'LineStyle', 'none');
 
axis([-2, 2, -1, 3, 0, 2500]);
xlabel('x', 'fontsize', 18);
ylabel('y', 'fontsize', 18);
zlabel('f', 'fontsize', 18);
 
% Note that the `-dsvg' option is only supported for Simulink systems
print(hfig, '-dsvg', 'rosenbrock');
% To produce eps and pdf, use the following code. Notice that `epstopdf' may not work on Windows. 
print(hfig, '-depsc', 'rosenbrock');
system('epstopdf rosenbrock.eps');

ライセンス

Public domain この著作物の著作権者である私は、この著作物における権利を放棄しパブリックドメインとします。これは全世界で適用されます。
一部の国では、これが法的に可能ではない場合があります。その場合は、次のように宣言します。
私は、あらゆる人に対して、法により必要とされている条件を除き、如何なる条件も課すことなく、あらゆる目的のためにこの著作物を使用する権利を与えます。

キャプション

このファイルの内容を1行で記述してください

このファイルに描写されている項目

題材

4 9 2009

ファイルの履歴

過去の版のファイルを表示するには、その版の日時をクリックしてください。

日付と時刻サムネイル寸法利用者コメント
現在の版2020年6月5日 (金) 01:192020年6月5日 (金) 01:19時点における版のサムネイル720 × 540 (2.28メガバイト)ZhangzkThe original colour looks much better (Reverted to version as of 11:52, 6 April 2010 (UTC))
2018年8月15日 (水) 15:252018年8月15日 (水) 15:25時点における版のサムネイル603 × 459 (1.21メガバイト)NicoguaroChange colormap to viridis. Smaller file.
2010年4月6日 (火) 11:522010年4月6日 (火) 11:52時点における版のサムネイル720 × 540 (2.28メガバイト)Morn{{Information |Description={{en|1=Rosenbrock function}} |Source={{own}} |Author=Morn the Gorn |Date=2009-09-04 |Permission= |other_versions= }} Category:Functions in two variables

このファイルを使用しているページはありません。

グローバルなファイル使用状況

以下に挙げる他のウィキがこの画像を使っています:

メタデータ