-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cleanup python modular graphical examples #3045
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,10 +11,9 @@ | |
from PyQt4.QtGui import * | ||
|
||
import matplotlib | ||
from matplotlib import mpl | ||
from matplotlib.colorbar import make_axes, Colorbar | ||
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas | ||
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as NavigationToolbar | ||
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar | ||
from matplotlib.figure import Figure | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
from modshogun import * | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,14 +11,11 @@ | |
from PyQt4.QtGui import * | ||
|
||
import matplotlib | ||
from matplotlib import mpl | ||
from matplotlib.colorbar import make_axes, Colorbar | ||
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas | ||
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as NavigationToolbar | ||
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar | ||
from matplotlib.figure import Figure | ||
|
||
from modshogun import * | ||
from modshogun import * | ||
from modshogun import * | ||
import util | ||
|
||
|
@@ -132,7 +129,7 @@ def train_svm(self): | |
svm.set_epsilon(1e-2) | ||
|
||
x, y, z = util.compute_output_plot_isolines(svm, gk, train) | ||
plt=self.axes.pcolor(x, y, z, shading='interp') | ||
plt=self.axes.pcolor(x, y, z) | ||
CS=self.axes.contour(x, y, z, [-1,0,1], linewidths=1, colors='black', hold=True) | ||
#CS=self.axes.contour(x, y, z, linewidths=1, colors='black', hold=True) | ||
#CS=self.axes.contour(x, y, z, 5, linewidths=1, colors='black', hold=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
@@ -142,7 +139,7 @@ def train_svm(self): | |
self.axes.set_ylim((-5,5)) | ||
|
||
cmap = matplotlib.cm.jet | ||
norm = mpl.colors.Normalize(numpy.min(z), numpy.max(z)) | ||
norm = matplotlib.colors.Normalize(numpy.min(z), numpy.max(z)) | ||
print CS.get_clim() | ||
if not self.cax: | ||
self.cax, kw = make_axes(self.axes) | ||
|
@@ -152,7 +149,7 @@ def train_svm(self): | |
# standalone colorbar. There are many more kwargs, but the | ||
# following gives a basic continuous colorbar with ticks | ||
# and labels. | ||
cb1 = mpl.colorbar.ColorbarBase(self.cax, cmap=cmap, | ||
cb1 = matplotlib.colorbar.ColorbarBase(self.cax, cmap=cmap, | ||
norm=norm) | ||
self.canvas.draw() | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gives import error so removing this.