Zoom/Pan state
vindex wrote at 2011-11-01 14:44:
Hi,
Is it possible to get/set where is centered the view in a plot, after several zooms and pans?
objo wrote at 2011-11-01 20:18:
I think it should be possible to use (ActualMinimum+ActualMaximum)/2 on each axis to find the center. These two values will contain the current minimum and maximum values of the axes after the plot has been updated or redrawn.
WPF: How to Plot Controls to Show Up in Toolbox?
alanrorr1 wrote at 2013-10-02 18:54:
I am amazed. This plot looks to be very well done. I am looking forward to using it. It is compiling and running well (just needed to update Nuget package and to be sure I ran update 3 of VS 2012 Express).
I hope this last hurdle is pretty small. Wondering, how do I get the controls to show up in the toolbox? I tried finding a dll or ?? where they were located by right clicking on "All WPF Controls" and selecting "Choose Items..." but could not find anything. Note that I installed OxyPlot.WPF using Nuget through VS.
Thanks,
Alan
Mono 2.10.x version, Not MonoTouch or Mono for Android
efontana2 wrote at 2013-04-29 16:04:
Mono: Could not load file or assembly 'System.core, Version 2.0.5.0 ...'
Has anyone tried this?
objo wrote at 2013-04-29 18:15:
Shouldn't PCL assemblies also work with Mono? (I have not tried myself)
http://slodge.blogspot.no/2012/12/cross-platform-winrt-monodroid.html
efontana2 wrote at 2013-04-29 18:56:
Mono: The following assembly referenced from /home/cds/eric/op/testoxy/bin/Debug/OxyPlot.dll could not be loaded:
Assembly: System.Core (assemblyref_index=2)
Version: 2.0.5.0
Public Key: 7cec85d7bea7798e
The assembly was not found in the Global Assembly Cache, a path listed in the MONO_PATH environment variable, or in the location of the executing assembly (/home/cds/eric/op/testoxy/bin/Debug/).
Mono: Failed to load assembly OxyPlot[0xb5728fb8]
Mono: Could not load file or assembly 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies.
Unhandled Exception: System.TypeLoadException: A type load exception has occurred.
at (wrapper remoting-invoke-with-check) testoxy.Form1:.ctor ()
at testoxy.Program.Main () [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: A type load exception has occurred.
at (wrapper remoting-invoke-with-check) testoxy.Form1:.ctor ()
at testoxy.Program.Main () [0x00000] in <filename unknown>:0
Tracker binding for barseries
F1j0k wrote at 2014-06-03 11:14:
I would like to ask, is it possible to bind X coordinate in tracker for BarSeries graph ?
thx
objo wrote at 2014-06-06 20:57:
There is a
TrackerChanged
event on the PlotModel
. I don't think we have exposed any bindable properties or a routed event for the tracker in the
PlotView
control. Maybe this should be added?ExampleLibrary_PCL Error: 'System.Type' does not contain a definition for 'Assembly'
rajah wrote at 2012-10-18 07:26:
When attempting to build the latest OxyPlot code, I was getting multiple errors of the form:
Error 1 'System.Type' does not contain a definition for 'Assembly' and no extension method 'Assembly' accepting a first argument of type 'System.Type' could be found (are you missing a using directive or an assembly reference?)
Error 2 'System.TimeZoneInfo' does not contain a definition for 'ConvertTimeFromUtc'
Error 3 'System.TimeZoneInfo' does not contain a definition for 'FindSystemTimeZoneById' Error 4 'Assembly' is an ambiguous reference between 'System.Reflection.Assembly' and 'OxyPlot.Assembly'
Error 5 'System.Reflection.Assembly' does not contain a definition for 'GetExecutingAssembly' Error 6 'Assembly' is an ambiguous reference between 'System.Reflection.Assembly' and 'OxyPlot.Assembly'
Error 7 'System.Reflection.Assembly' does not contain a definition for 'GetExecutingAssembly'
I was able to get around this problem by defining the PCL conditional compilation symbol for the ExampleLibrary_PCL project. (METRO,PCL)
Hope this helps someone else
objo wrote at 2012-10-18 08:59:
Thanks for the messages. I found some build errors in the Silvelight/Metro projects - should be corrected now. The metro example browser seems to work, so I think the PCL ExampleLibrary should be ok now.
How to set two differents magnitudes for a Polar plot?
ralphbernardes wrote at 2014-05-15 19:01:
I´m using OxyPlot in a project which requires a Polar plot with two different Magnitude Axis. I was able to make the plot update its series but when I updated the magnitude axis it only considers what was put last.
I mean, it looks that even though we can add as many axes we want through Plot.Axes.Add... it is not considering all the axes.
What I need is a way of having one magnitude axis for one set of series, then it would represent those values on the plot and then scale this axis setting the value of the Magnitude.Maximum value.
This would be necessary in case the data ploted is very small or very big, then I would have to resize the plot down or up in order to really examine the chart.
Any idea how it works or how it is done or even if this can be done?
Thanks again for this amazing tool!
Ralph
ps: Moved from Issues, where I had misplaced the thread. Thanks.
ralphbernardes wrote at 2014-05-15 20:50:
My Polar Plot has four axes (two angle and two magnitude), the first measures three things so it has three series. The second also measures three values and has its three series.
I did as Oystein suggested here:
(maybe this should be posted under discussions)I gave a key to each one of my axes and for each series related I set the XAxisKey for the MagnitudeAxis and YAxisKey for AngleAxis.
did you try setting the Keyon the axes and the XAxisKey on the series? I think it is a bug if this does not work.
Thanks a lot.
Ralph
Confusion Matrices
pcp16 wrote at 2013-12-10 15:13:
Hi, I'm new here. This is first thread. I had a look at the other threads before posting: there's none about "confusion matrices".
What I'm trying to do is use the HeatMapSeries in order to have something like:
http://t1.gstatic.com/images?q=tbn:ANd9GcRpKII2C_wm5ZOiazRv1WL2eZsg9gKmtlnxeUiMQPCIThWL6SWR
I now have something which looks good (I have "categories" axes, with tilted labels).
The two issues I'm having are:
1) I'd like to have a grayscale that goes from white=0 to black=1.
2) I'd like to print the values in the center of the cells (like in the example I provided).
I tried googling (should I say binging? ;P) this around, but could not find an answer.
Regards,
Pau.
P.S: I noticed that you can invert the axis (say the vertical one startPosition=1; endPosition=0) so that the categories look "symmetrical" like in my example, ... but is there a way to automatically invert the data accordingly?
objo wrote at 2013-12-11 07:35:
1) I think you can use
OxyPalette.Interpolate(100, OxyColors.White, OxyColors.Black)
where the value is the number of colors of the palette.
2) This is new functionality. You can create a subclass of HeatMapSeries and override the Render method, or add the new functionality to the HeatMapSeries (I see this can be useful in other cases where you don't have a lot of cells)
The inverted axes should be handled by HeatMapSeries when creating the image to be rendered. It is possible this is not supported yet. But this should absolutely be fixed. The image renderers do not support flipping/scaling of images, so this must be handled when generating the image.
pcp16 wrote at 2013-12-11 12:46:
1) Solved, yes, you can use that and it works.
2) I have created a modified version of HeatMapSeries, that does exactly what I need:
2.a) Renders the numbers in the center of the cells by using rc.DrawText() (and scales them appropriately)
2.b) Renders the matrix in "inverse order" to make it coincide with the "symmetrical" axes.
This is how it looks:
[EDIT: Yes, it shows commas, instead of dots for number separations, due to my locale]
And this is the code:
ConfusionMatrixSeries.cs
And, finally, this is how I generate the model:
public static PlotModel ConfMatrix()
{
var data = new double[3, 3];
data[0, 0] = 1;
data[1, 1] = 0.8;
data[1, 2] = 0.2;
data[2, 2] = 1;
string[] cat1 = { "class A", "class B", "class C" };
var model = new PlotModel("Confusion Matrix");
var palette = OxyPalette.Interpolate(50, OxyColors.White, OxyColors.Black);
var lca = new LinearColorAxis { Position = AxisPosition.Right, Palette = palette, HighColor = OxyColors.White, LowColor = OxyColors.White };
model.Axes.Add(lca);
var axis1 = new CategoryAxis(AxisPosition.Top, "Actual class", cat1);
model.Axes.Add(axis1);
// We invert this axis, so that they look "symmetrical"
var axis2 = new CategoryAxis(AxisPosition.Left, "Predicted class", cat1);
axis2.Angle = -90;
axis2.StartPosition = 1;
axis2.EndPosition = 0;
model.Axes.Add(axis2);
var hms = new ConfusionMatrixSeries(data);
model.Series.Add(hms);
return model;
}
Enjoy!Pau.
objo wrote at 2013-12-11 21:09:
pcp16 wrote at 2013-12-11 22:53:
objo wrote at 2013-12-12 07:44:
But there should be an option that determines if the indices of the array are [ix,iy] or [iy,ix] (where ix is the index along the x-axis and iy is the index along the y-axis).
pcp16 wrote at 2013-12-12 10:58:
/// <summary>
/// Updates the image.
/// </summary>
private void UpdateImage()
{
int m = this.Data.GetLength(0);
int n = this.Data.GetLength(1);
var buffer = new OxyColor[m, n];
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
buffer[i, j] = this.ColorAxis.GetColor(this.Data[j, i]);
}
}
this.image = OxyImage.Create(buffer, ImageFormat.Png);
}
I'm not sure if this is the correct procedure, or this could be done by changing X0, X1, etc. But I don't think so ... this code doesn't take X0,X1 into account at all, right?Pau.
objo wrote at 2013-12-12 20:32:
HeatMapSeries
. I applied a Transpose
method to your data set in the example!
The transpose could be implemented in the
HeatMapSeries
with a new option, I suggest a bool property
Transpose
or an enum property IndexOrder
defined as
{ XY, YX }
OxyPlot and F#
amouhsine wrote at 2013-04-29 21:51:
First, this is a great work so far. Nice library.
Is there any tutorial (or maybe translation of the wpf examples) in F# for F#ers?
that would be great.
Thanks in advance
Anass
objo wrote at 2013-05-06 10:47:
I found some examples with other libraries
http://www.ffconsultancy.com/products/fsharp_for_visualization/
http://stackoverflow.com/questions/3276357/how-do-i-plot-a-data-series-in-f
http://fssnip.net/2l
It should be possible to do the same for this library!
this.plot1.Model
yribbens wrote at 2014-05-22 01:58:
https://oxyplot.codeplex.com/SourceControl/latest#Source/Examples/DocumentationExamples/HelloWorld/WindowsFormsApplication1/Form1.cs
namespace WindowsFormsApplication1
{
using System;
using System.Windows.Forms;
using OxyPlot;
using OxyPlot.Series;
public partial class Form1 : Form
{
public Form1()
{
this.InitializeComponent();
var myModel = new PlotModel("Example 1");
myModel.Series.Add(new FunctionSeries(Math.Cos, 0, 10, 0.1, "cos(x)"));
this.plot1.Model = myModel;
}
}
}Can someone explain where plot1 is created? I get an error that this definition does not exist.
Thanks!
objo wrote at 2014-05-23 08:17:
plot1
should be a PlotView
control added to the form.OxyPlot on Silverlight 5 vs2010
ChevyCP wrote at 2013-06-19 15:27:
objo wrote at 2013-06-19 20:41:
http://visualstudiogallery.msdn.microsoft.com/b0e0b5e9-e138-410b-ad10-00cb3caf4981
To get the assemblies, use
nuget: http://nuget.org/List/Packages/OxyPlot.Silverlight
or download OxyPlot-SL5-x.x.x.x.zip
Reference OxyPlot.dll (a portable class library) and OxyPlot.Silverlight.dll
objo wrote at 2013-06-20 08:57:
It's a larger file (28Mb), but it should be easier to find the assemblies you need.
ChevyCP wrote at 2013-06-20 16:52:
Warning 1 The following exception occurred creating the MEF composition container:
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
The default code generator will be used. C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v5.0\Microsoft.Ria.Client.targets 303 5
ChevyCP wrote at 2013-06-20 18:47:
Servicio de atención al cliente por UserEcho