Customizing a 3D Plotly Visualization with a slider bar - matlab

I've been exploring Plotly recently. I've made a contourslice of a 3D Value function using the Plotly MATLAB API's fig2plotly(). However, I've been researching how to further customize the plot, and I can't figure out how exactly I'd go about doing this.
My current plot is here:
https://plot.ly/~txizzle/81
It's basically different contours stacked on top of each other.
My goals:
I'd like to add a slider bar that will show just one contour slice at a time (maybe by changing visibility). Ideally, I could fix an eagle-eye view from the top, so moving the slider will make it appear as if the plot is 2D.
My thoughts on how to approach this:
1) https://plot.ly/javascript-graphing-library/range-slider/ seems to be an HTML/JS implementation of a custom slider bar that changes the x-axis range of a line chart. From what I've read, this approach seems to be Node.js only. Ideally, I'd like to implement something in just HTML/JS/JQuery/D3.js.
2) Alternatively, I could use a 2D contour plot instead of a 3D contourslice:
https://plot.ly/49/~txizzle/
However, now, I will need to have many of these contour plots. I'm not sure how I would switch between different contour plots with a slider.
My Questions:
1) How do I customize Plotly plots? Is this possible without relying on Node.js? I don't want to just embed the plots using Plotly's given auto-embedder, because it abstracts everything away.
2) Should I do a contourslice or many different contour plots?
3) How do I add a slider bar to switch the visibility of different contour slices, or how do I add a slider bar to switch different plots entirely?
Thank you for your time! Looking forward to explore Plotly more.

Since you used the MATLAB library to generate the plotly figure, you can add slider effects by embedding the plotly figure as an iframe in an offline HTML doc, then using Plotly's postmessage API.
Here's an example:
https://plot.ly/matlab/range-slider/
postMessage API:
https://github.com/plotly/postMessage-API

Related

how to draw a bar graph with tow y- axis in iOS?

I am using core-plot framework for drawing graphs. But I need to draw two bars with two y-axis. Please help providing sample code/example links.
Thanks in advance.
For your requirement this bellow link is very useful to you..also in this example many graphs and charts available
MIMChart-Library
and this tutorial with core-plot library
how-to-draw-graphs-with-core-plot-part
using-core-plot-to-draw-line-graphs
i hope this help you..
The "Axis Demo" in the Plot Gallery example app included with Core Plot shows how to do this. You create another axis and add it to the axes array of the axis set. The secondary y-axis can share the same plot space as the other axes or be assigned to another plot space if it needs to have a different scale.

How to get MATLAB zoom context menu "Reset to Original View" to work on a 3D plot?

I have several plots on one figure. One is a 3D plot, the rest are 2D. When I select Zoom on the toolbar, left clicking on the mouse uses the zoom.m functions, and in 3D, it looks like it uses camzoom.m. However, when I right click to bring up the context menu, the "Reset to Original View" looks like it only works on the 2D plots. For the 3D plot, selecting this either does nothing or it loses the x-axis limits, and therefore the plot shows no data points (I can't get it to work consistently).
I'm trying to come up with a workaround for this problem.
I would like to override the context menu for just the 3D plot with my own function that would redraw the plot, and leave the default context menu for the 2D plots. Is this possible? I'm thinking no, as there is only one zoom object for the entire figure, and MATLAB does not let me set the handle to the context menu while zoom is on.
Is there a way to get around this problem? It looks like an oversight on MATLAB's part to not have this function correctly!

Core Plot - Hide graph beyond one side of axis

I'm looking for a way to hide parts of a graph (namely the axes and plot) on a certain side of an axis (enclosed by the red boxes in the image below). I would like the labels to still be visible and the graph to still be scrollable.
I've tried setting visibleRange but it hides the axes for a fixed range, and doesn't quite work when the graph is scrollable.
Thanks in advance for any help.
Set padding on the plot area frame. See the Plot Gallery example app for sample code.
Just i have an idea, but i am not sure whether this will satisfy you or not.
I have used the axisContstrains property for both X and Y axis.
So the plots inside your boxes are not plotted for me. I hope this will help to this questions.

Core Plot ios animate scatter plot from plain, straight line to plot with actual data

I've been using Core Plot for my iPhone application and have been displaying a scatter plot. I was wondering if upon appearance of the view, there is anyway to have the scatter plot start off as just a horizontal line with all y-values the same, and then have some sort of 0.5 second, for example, animation that slowly moves each data point up or down to its appropriate position?? Or, more generally, if the scatter plot can be animated in any way using core plot? Thank you all in advance.
There's nothing like that built in at the moment. Each plot is drawn in its own CALayer which can be animated like any other layer. For example, you can slide it into place or fade it into view.

Draw graph using accelerometer data in core-plot

I'm new to this core-plot framework and trying to draw a line graph based on X and Y acceleration. I can already get my X and Y values and have successfully added core-plot in my project. I'm quite lost on how to start this, so basically, I will have X and Y values and how do I plot this using core-plot? any help is suggested. Thanks!
Maybe my answer is a little bit off topic, as it's not using core-plot, but did you look at the "AccelerometerGraph" sample app provided with Xcode?
It provides a nice plot which is dynamically updated while new accelerometer events are registered. The great of this sample is the way CoreAnimation has been used to "speed-up" Quartz2D. And you get all of this using system framework only and no third party code (apart your adaptation of Apple's one).
Look at the Core Plot examples to see how to set up a basic graph. You'll want to use a scatter plot. Call -reloadData on the plot whenever you have new data to display. If only some of the data points change on each frame, you can use the following methods to do a partial update:
-(void)reloadDataInIndexRange:(NSRange)indexRange;
-(void)insertDataAtIndex:(NSUInteger)index
numberOfRecords:(NSUInteger)numberOfRecords;
-(void)deleteDataInIndexRange:(NSRange)indexRange;
The Real Time Plot in the Plot Gallery example app shows one way to use these methods.